152
|
1 // { dg-do compile { target c++14 } }
|
|
2 // PR 94426 ICE mangling lambda
|
|
3
|
|
4 template <bool> using Void = void;
|
|
5
|
|
6 template <typename U> bool Init (U) {return true;}
|
|
7 template <typename> bool VAR = Init ([] {});
|
|
8
|
|
9 template <typename T>
|
|
10 Void<false && VAR<T>> Foo (T)
|
|
11 {}
|
|
12
|
|
13 void q ()
|
|
14 {
|
|
15 Foo ([] {});
|
|
16 }
|
|
17
|
|
18 // The instantiation of VAR becomes local
|
|
19 // { dg-final { scan-assembler {.local _Z3VARIZ1qvEUlvE_E} { target { { i?86-*-* x86_64-*-* } && { ! *-*-darwin* } } } } }
|
|
20 // { dg-final { scan-assembler {.comm _Z3VARIZ1qvEUlvE_E,1,1} { target { { i?86-*-* x86_64-*-* } && { ! *-*-darwin* } } } } }
|
|
21
|
|
22 // The instantiation of VAR becomes local
|
|
23 // { dg-final { scan-assembler-not {.globl[ \t]+_?_Z4InitIN3VARIZ1qvEUlvE_EUlvE_EEbT_} { target *-*-darwin* } } }
|
|
24 // { dg-final { scan-assembler-not {.weak(_definition)?[ \t]+_?_Z4InitIN3VARIZ1qvEUlvE_EUlvE_EEbT_} { target { i?86-*-* x86_64-*-* *-*-darwin* } } } }
|
|
25 // Make sure it is defined with the mangling we expect.
|
|
26 // { dg-final { scan-assembler {_?_Z4InitIN3VARIZ1qvEUlvE_EUlvE_EEbT_:} { target { i?86-*-* x86_64-*-* *-*-darwin* } } } }
|