Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/decltype39.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 // PR c++/53788 |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 struct t { static const bool value = true; }; | |
5 struct f { static const bool value = false; }; | |
6 | |
7 template<typename T> | |
8 struct has_static { | |
9 template<typename X> | |
10 static t check(X*, decltype(T::fun())* = 0); // { dg-error "without object" } | |
11 static f check(...); | |
12 | |
13 typedef decltype(check((T*)(0))) ret; | |
14 static const bool value = ret::value; | |
15 }; | |
16 | |
17 struct test { int fun() { return 0; } }; | |
18 | |
19 bool b = has_static<test>::value; |