]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/sfinae47.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / sfinae47.C
1 // Source: Comment 16 of PR51213
2 // { dg-do compile { target c++11 } }
3
4 template <class T>
5 T && declval();
6
7 template <class T>
8 constexpr auto hasSize(int) -> decltype(declval<T&>().size(), bool())
9 { return true; }
10
11 template <class T>
12 constexpr bool hasSize(...)
13 { return false; }
14
15 struct A
16 {
17 int size();
18 };
19
20 struct B : private A
21 {
22 };
23
24 static_assert(hasSize<A>(0), "A");
25 static_assert(!hasSize<B>(0), "B");
This page took 0.041419 seconds and 5 git commands to generate.