| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
// { dg-additional-options "-fkeep-inline-functions" } |
| 3 |
// See also https://github.com/itanium-cxx-abi/cxx-abi/pull/85 |
| 4 |
|
| 5 |
struct A { |
| 6 |
decltype([]{ return 1; }) f; |
| 7 |
}; |
| 8 |
|
| 9 |
struct B : decltype([]{ return 2; }) { |
| 10 |
decltype([]{ return 3; }) f; |
| 11 |
}; |
| 12 |
|
| 13 |
template <typename T> |
| 14 |
struct C : decltype([]{ return 4; }) { |
| 15 |
decltype([]{ return 5; }) f; |
| 16 |
}; |
| 17 |
|
| 18 |
template struct C<int>; |
| 19 |
template struct C<double>; |
| 20 |
|
| 21 |
// { dg-final { scan-assembler {_ZNK1AUlvE_clEv:} } } |
| 22 |
// { dg-final { scan-assembler {_ZNK1BUlvE_clEv:} } } |
| 23 |
// { dg-final { scan-assembler {_ZNK1BUlvE0_clEv:} } } |
| 24 |
// { dg-final { scan-assembler {_ZNK1CIiEUlvE_clEv:} } } |
| 25 |
// { dg-final { scan-assembler {_ZNK1CIiEUlvE0_clEv:} } } |
| 26 |
// { dg-final { scan-assembler {_ZNK1CIdEUlvE_clEv:} } } |
| 27 |
// { dg-final { scan-assembler {_ZNK1CIdEUlvE0_clEv:} } } |