Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/sfinae28.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 // Origin: PR c++/44267 |
2 | |
3 struct B {}; | |
4 struct D : B {}; | |
5 struct VD : virtual B {}; | |
6 | |
7 template <class T> T create(); | |
8 | |
9 typedef char one[1]; | |
10 typedef char two[2]; | |
11 | |
12 template <class D, class B> | |
13 one& f(char (*)[sizeof(static_cast<D>(create<B>()))]); | |
14 | |
15 template <class D, class B> | |
16 two& f(...); | |
17 | |
18 int main() | |
19 { | |
20 f<D*, int>(0); | |
21 f<D*, B*>(0); | |
22 f<VD*, B*>(0); | |
23 return 0; | |
24 } |