Daily bump.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / lambda-mangle.C
blob35abc9179e70e8f990b91803f037a2c7cc48f3cc
1 // Test lambda mangling
2 // { dg-do compile { target c++20 } }
3 // { dg-require-weak "" }
4 // { dg-options "-fno-inline" }
6 template<typename T> struct R {
7   static int x;
8 };
9 // "int i;" makes the op() non-constexpr in C++17.  In C++20, it does not.
10 template<typename T> int R<T>::x = []{int i; return 1;}();
11 template int R<int>::x;
12 // Type of lambda in intializer of R<int>::x: N1RIiE1xMUlvE_E
13 // Corresponding operator(): _ZNK1RIiE1xMUlvE_clEv
14 // { dg-final { scan-assembler-not "_ZNK1RIiE1xMUlvE_clEv" } }
15 // { dg-final { scan-assembler-not "weak\[^\n\r\]*_?_ZNK1RIiE1xMUlvE_clEv" } }