| 1 |
// { dg-options "-Wabi-tag" } |
| 2 |
|
| 3 |
inline namespace __cxx11 __attribute ((abi_tag ("cxx11"))) { |
| 4 |
struct A {}; |
| 5 |
}; |
| 6 |
|
| 7 |
// { dg-final { scan-assembler "_Z1aB5cxx11" } } |
| 8 |
A a; // { dg-warning "\"cxx11\"" } |
| 9 |
|
| 10 |
// { dg-final { scan-assembler "_Z1fB5cxx11v" } } |
| 11 |
A f() { return a; } // { dg-warning "\"cxx11\"" } |
| 12 |
|
| 13 |
namespace { |
| 14 |
A a2; |
| 15 |
A f2() { return a2; } |
| 16 |
struct B: A {}; |
| 17 |
} |
| 18 |
|
| 19 |
// { dg-final { scan-assembler "_Z1fPN7__cxx111AE" } } |
| 20 |
A f(A*) { return a; } |
| 21 |
|
| 22 |
// { dg-final { scan-assembler "_Z1gIN7__cxx111AEET_v" } } |
| 23 |
template <class T> T g() { } |
| 24 |
template <> A g<A>() { return a; } |
| 25 |
|
| 26 |
// { dg-final { scan-assembler "_Z1vIN7__cxx111AEE" { target c++14 } } } |
| 27 |
#if __cplusplus >= 201402L |
| 28 |
template <class T> T v = T(); |
| 29 |
void *p = &v<A>; |
| 30 |
#endif |