annotate gcc/testsuite/g++.dg/template/spec15.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile }
kono
parents:
diff changeset
2 // Contributed by Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
kono
parents:
diff changeset
3 // PR c++/509: Make sure specializations of member templates match correctly
kono
parents:
diff changeset
4 // between template and non-template overloads.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 template <class T>
kono
parents:
diff changeset
7 struct A {
kono
parents:
diff changeset
8 template <class U> void f (U);
kono
parents:
diff changeset
9 void f2 (int);
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 template <class U> void h (U);
kono
parents:
diff changeset
12 void h (long);
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 template <>
kono
parents:
diff changeset
16 struct A<float> {
kono
parents:
diff changeset
17 template <class U> void g (U);
kono
parents:
diff changeset
18 void g2 (float);
kono
parents:
diff changeset
19 };
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 template <> void A<int>::f (int); // { dg-error "" }
kono
parents:
diff changeset
22 // { dg-message "need 2" "" { target *-*-* } .-1 }
kono
parents:
diff changeset
23 template <> template <> void A<int>::f (int);
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 template <> void A<int>::f2 (int);
kono
parents:
diff changeset
26 template <> template <> void A<int>::f2 (int); // { dg-error "" }
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 template <> void A<float>::g (float);
kono
parents:
diff changeset
29 template <> template <> void A<float>::g(float); // { dg-error "" }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 template <> void A<float>::g2 (float); // { dg-error "" }
kono
parents:
diff changeset
32 template <> template <> void A<float>::g2(float); // { dg-error "" }
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 template <> void A<long>::h (long);
kono
parents:
diff changeset
35 template <> template <> void A<long>::h(long);