Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/sfinae28.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
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 } |