PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / abi / abi-tag21.C
blob53599f7f4c331815ceebf77f363ef92755b989fe
1 // { dg-do compile { target c++11 } }
2 // { dg-options -Wabi=10 }
4 struct [[gnu::abi_tag ("foo")]] A
6   template <class T> static T f();
7   template <class T> static A g();
8 };
10 template <class T> struct B
12   static decltype(A::f<T>()) fa(decltype(A::f<T>()));
13   static decltype(A::f<T>()) fv(); // { dg-warning "mangled name" }
14   static decltype(A::g<T>()) ga(decltype(A::g<T>()));
15   static decltype(A::g<T>()) gv();
16   template <class U> 
17   static decltype(A::f<U>()) hv();
20 int main()
22   B<int>::fa(0);     // { dg-final { scan-assembler "_ZN1BIiE2faEi" } }
23   B<int>::fv();      // { dg-final { scan-assembler "_ZN1BIiE2fvEv" } }
24   B<int>::ga(A());   // { dg-final { scan-assembler "_ZN1BIiE2gaE1AB3foo" } }
25   B<int>::gv();      // { dg-final { scan-assembler "_ZN1BIiE2gvB3fooEv" } }
26   B<int>::hv<int>(); // { dg-final { scan-assembler "_ZN1BIiE2hvIiEEDTclsr1AB3foo1fIT_EEEv" } }