[clang] [clang-repl] Fix error recovery while PTU cleanup (PR #127467)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 31 22:41:51 PDT 2025


================
@@ -14,4 +15,13 @@ auto r2 = l2();
 auto r3 = l2();
 // CHECK: TWO
 
-%quit
+// Verify non-local lambda capture error is correctly reported
+int x = 42;
+
+// expected-error {{non-local lambda expression cannot have a capture-default}}
+auto capture = [&]() { return x * 2; };
+
----------------
vgvassilev wrote:

Don’t we want to check the value of X here to be 84?

https://github.com/llvm/llvm-project/pull/127467


More information about the cfe-commits mailing list