comparison gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
45 // Operator: _ZZN1S1fEiiEd_NKUlvE_clEv 45 // Operator: _ZZN1S1fEiiEd_NKUlvE_clEv
46 // { dg-final { scan-assembler "_ZZN1S1fEiiEd_NKUlvE_clEv" } } 46 // { dg-final { scan-assembler "_ZZN1S1fEiiEd_NKUlvE_clEv" } }
47 []{return 3;}()); 47 []{return 3;}());
48 }; 48 };
49 49
50 template<typename T> struct R {
51 static int x;
52 };
53 // "int i;" makes the op() non-constexpr in C++17.
54 template<typename T> int R<T>::x = []{int i; return 1;}();
55 template int R<int>::x;
56 // Type of lambda in intializer of R<int>::x: N1RIiE1xMUlvE_E
57 // Corresponding operator(): _ZNK1RIiE1xMUlvE_clEv
58 // { dg-final { scan-assembler "_ZNK1RIiE1xMUlvE_clEv" } }
59 // { dg-final { scan-assembler "weak\[^\n\r\]*_?_ZNK1RIiE1xMUlvE_clEv" { target { ! { *-*-mingw* *-*-cygwin } } } } }
60
61 void bar() 50 void bar()
62 { 51 {
63 // lambdas in non-vague linkage functions have internal linkage. 52 // lambdas in non-vague linkage functions have internal linkage.
64 // { dg-final { scan-assembler-not "weak\[^\n\r\]*bar\[^\n\r\]*Ul" } } 53 // { dg-final { scan-assembler-not "weak\[^\n\r\]*bar\[^\n\r\]*Ul" } }
65 []{}(); 54 []{}();