File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ void IncrementalParser::CleanUpPTU(TranslationUnitDecl *MostRecentTU) {
176
176
// FIXME: We should de-allocate MostRecentTU
177
177
for (Decl *D : MostRecentTU->decls ()) {
178
178
auto *ND = dyn_cast<NamedDecl>(D);
179
- if (!ND)
179
+ if (!ND || ND-> getDeclName (). isEmpty () )
180
180
continue ;
181
181
// Check if we need to clean up the IdResolver chain.
182
182
if (ND->getDeclName ().getFETokenInfo () && !D->getLangOpts ().ObjC &&
Original file line number Diff line number Diff line change 1
1
// REQUIRES: host-supports-jit
2
2
// UNSUPPORTED: system-aix
3
3
// RUN: cat %s | clang-repl | FileCheck %s
4
- // RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
4
+ // RUN: cat %s | not clang-repl -Xcc -Xclang -Xcc -verify -Xcc -O2 | FileCheck %s
5
+
5
6
extern " C" int printf (const char *, ...);
6
7
7
8
auto l1 = []() { printf (" ONE\n " ); return 42 ; };
@@ -14,4 +15,10 @@ auto r2 = l2();
14
15
auto r3 = l2();
15
16
// CHECK: TWO
16
17
17
- %quit
18
+ // Verify non-local lambda capture error is correctly reported
19
+ int x = 42 ;
20
+
21
+ // expected-error@+1 {{non-local lambda expression cannot have a capture-default}}
22
+ auto capture = [&]() { return x * 2 ; };
23
+
24
+ %quit
You can’t perform that action at this time.
0 commit comments