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

struct X
{
  constexpr X() { }
  constexpr X f(X x) { return x; }
  constexpr X g(X x);
};

constexpr X X::g(X x) { return x; }

struct Y
{
  Y() { }
  constexpr Y f(Y y);		// { dg-error "not a literal type" }
  static constexpr Y g(Y y) {}	// { dg-error "constexpr" }
};