aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/sfinae28.C
blob: 1eeba64bc1dc326314cd27fb94d4940a4556ed64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// PR c++/50324
// { dg-do compile { target c++11 } }

struct complete { };
struct incomplete;

template<class T> auto f(T *) -> decltype(T{}) *;
template<class T> char f(T);

int main()
{
  complete *p = 0;
  static_assert(sizeof(f(p)) == sizeof(void*), "");
  incomplete *q = 0;
  static_assert(sizeof(f(q)) == 1u, "");
}