Debian Codegraph @

gcc/testsuite/g++.dg/template/spec15.C

raw
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.
5
6 template <class T>
7 struct A {
8 template <class U> void f (U);
9 void f2 (int);
10
11 template <class U> void h (U);
12 void h (long);
13 };
14
15 template <>
16 struct A<float> {
17 template <class U> void g (U);
18 void g2 (float);
19 };
20
21 template <> void A<int>::f (int); // { dg-error "" }
22 // { dg-message "need 2" "" { target *-*-* } .-1 }
23 template <> template <> void A<int>::f (int);
24
25 template <> void A<int>::f2 (int);
26 template <> template <> void A<int>::f2 (int); // { dg-error "" }
27
28 template <> void A<float>::g (float);
29 template <> template <> void A<float>::g(float); // { dg-error "" }
30
31 template <> void A<float>::g2 (float); // { dg-error "" }
32 template <> template <> void A<float>::g2(float); // { dg-error "" }
33
34 template <> void A<long>::h (long);
35 template <> template <> void A<long>::h(long);