c++: Implement P2615 'Meaningful Exports' [PR107688]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / linkage-spec1.C
blob9e8d59790593f58523a6284045f6f4c29eaec372
1 // PR c++/107688
2 // P2615R1: Meaningful exports: Newly invalid declarations
3 // { dg-do compile { target c++11 } }
5 extern "C++" template <typename T> struct A {};
7 extern "C++" template <typename T> struct A<T*> {};
9 extern "C++" template <> struct A<int*> {};
10 // { dg-error "explicit specializations are not permitted here" "" { target c++20 } .-1 }
12 extern "C++" template struct A<int>;
13 // { dg-error "explicit instantiations are not permitted here" "" { target c++20 } .-1 }
16 // These should all still be valid, though
17 extern "C++" {
18   template <typename T> struct B {};
19   template <typename T> struct B<T*> {};
20   template <> struct B<int*> {};
21   template struct B<int>;