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) {
176176 // FIXME: We should de-allocate MostRecentTU
177177 for (Decl *D : MostRecentTU->decls ()) {
178178 auto *ND = dyn_cast<NamedDecl>(D);
179- if (!ND)
179+ if (!ND || ND-> getDeclName (). isEmpty () )
180180 continue ;
181181 // Check if we need to clean up the IdResolver chain.
182182 if (ND->getDeclName ().getFETokenInfo () && !D->getLangOpts ().ObjC &&
Original file line number Diff line number Diff line change 11// REQUIRES: host-supports-jit
22// UNSUPPORTED: system-aix
33// 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+
56extern " C" int printf (const char *, ...);
67
78auto l1 = []() { printf (" ONE\n " ); return 42 ; };
@@ -14,4 +15,10 @@ auto r2 = l2();
1415auto r3 = l2();
1516// CHECK: TWO
1617
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