PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / template / spec15.C
blobe76b9112d966b263ac953233a1f9042eaabb23e6
1 // { dg-do compile }
2 // Contributed by Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
3 // PR c++/509: Make sure specializations of member templates match correctly
4 //  between template and non-template overloads.
6 template <class T>
7 struct A {
8   template <class U> void f (U);
9   void f2 (int);
11   template <class U> void h (U);
12   void h (long);
15 template <>
16 struct A<float> {
17   template <class U> void g (U);
18   void g2 (float);
21 template <> void A<int>::f (int);                    // { dg-error "" }
22 // { dg-message "need 2" "" { target *-*-* } .-1 }
23 template <> template <> void A<int>::f (int);
25 template <> void A<int>::f2 (int);
26 template <> template <> void A<int>::f2 (int);       // { dg-error "" }
28 template <> void A<float>::g (float);
29 template <> template <> void A<float>::g(float);     // { dg-error "" }
31 template <> void A<float>::g2 (float);               // { dg-error "" }
32 template <> template <> void A<float>::g2(float);    // { dg-error "" }
34 template <> void A<long>::h (long);
35 template <> template <> void A<long>::h(long);