Add execution tests of ARM EXT intrinsics
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-diag1.C
blob34cdb733e52d1cb7ecf638e24448242256692ddd
1 // Test that we explain why a template instantiation isn't constexpr
2 // { dg-do compile { target c++11 } }
4 template <class T>
5 struct A
7   T t;
8   constexpr int f() { return 42; } // { dg-error "enclosing class" }
9 };
11 struct B { B(); operator int(); };
13 constexpr A<int> ai = { 42 };
14 constexpr int i = ai.f();
16 constexpr int b = A<B>().f();   // { dg-error "non-constexpr function" }
18 template <class T>
19 constexpr int f (T t) { return 42; } // { dg-error "parameter" }
20 constexpr int x = f(B());            // { dg-error "constexpr" }