================
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -std=c++17
-verify=expected %s
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -std=c++17
-verify=expected %s -fexperimental-new-constant-interpreter
+constexpr void undefined(); // expected-note {{declared here}}
+static constexpr int r = [] { // expected-error {{constexpr variable 'r' must
be initialized by a constant expression}} \
+ expected-note {{in call to '[]
{}.operator()()'}}}
+ undefined(); // expected-note {{undefined function 'undefined' cannot be
used in a constant expression}}
+ return 0;
+ }();
+
----------------
shermpay wrote:
I added more a couple more tests:
1. Nested lambdas
2. type error
3. assigning the lambda to a variable and invoking it later
4. calling a lambda with a parameter
https://github.com/llvm/llvm-project/pull/185800
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits