Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / cxx23-static-callop-lambda-expression.cpp
blobfab76ffc423a3b231e4bdc492e4a745435ee7913
1 // RUN: %clang_cc1 -std=c++23 -fsyntax-only -verify %s
4 namespace ns1 {
5 auto lstatic = []() static { return 3; };
6 int (*f2)(void) = lstatic;
10 namespace ns1_1 {
12 auto lstatic = []() static consteval //expected-error{{cannot take address of consteval call}} \
13 expected-note {{declared here}}
14 { return 3; };
16 // FIXME: the above error should indicate that it was triggered below.
17 int (*f2)(void) = lstatic;
22 namespace ns2 {
23 auto lstatic = []() static { return 3; };
24 constexpr int (*f2)(void) = lstatic;
25 static_assert(lstatic() == f2());
28 namespace ns3 {
29 void main() {
30 static int x = 10;
31 auto L = []() static { return x; };