view gcc/testsuite/g++.dg/abi/abi-tag14.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-options "-Wabi-tag" }

inline namespace __cxx11 __attribute ((abi_tag ("cxx11"))) {
  struct A {};
};

// { dg-final { scan-assembler "_Z1aB5cxx11" } }
A a;				// { dg-warning "\"cxx11\"" }

// { dg-final { scan-assembler "_Z1fB5cxx11v" } }
A f() { return a; }		// { dg-warning "\"cxx11\"" }

namespace {
  A a2;
  A f2() { return a2; }
  struct B: A {};
}

// { dg-final { scan-assembler "_Z1fPN7__cxx111AE" } }
A f(A*) { return a; }

// { dg-final { scan-assembler "_Z1gIN7__cxx111AEET_v" } }
template <class T> T g() { }
template <> A g<A>() { return a; }

// { dg-final { scan-assembler "_Z1vIN7__cxx111AEE" { target c++14 } } }
#if __cplusplus >= 201402L
template <class T> T v = T();
void *p = &v<A>;
#endif