Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/cpp2a/fn-template12.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // P0846R0 | |
2 // { dg-do compile } | |
3 // { dg-options "-std=c++2a" } | |
4 | |
5 struct S { | |
6 template<typename T> int foo(T); | |
7 template<typename T> int foo(T, T); | |
8 template<typename T> int foo(T, T, T); | |
9 }; | |
10 | |
11 template<typename T> | |
12 struct W { | |
13 template<typename U> T foo(U); | |
14 template<typename U> T foo(U, U); | |
15 template<typename U> T foo(U, U, U); | |
16 }; | |
17 | |
18 void | |
19 test () | |
20 { | |
21 S s; | |
22 s.foo<int>(1); | |
23 s.foo<int>(1, 2); | |
24 s.foo<int>(1, 2, 3); | |
25 | |
26 W<int> w; | |
27 w.foo<int>(1); | |
28 w.foo<int>(1, 2); | |
29 w.foo<int>(1, 2, 3); | |
30 | |
31 w.nothere<int>(1); // { dg-error "has no member|expected" } | |
32 s.nothere<int>(1); // { dg-error "has no member|expected" } | |
33 } |