* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-ex3.C
bloba5893563eecc66a3f6bdadf4f0216fdb7f2de750
1 // { dg-do compile { target c++11 } }
2 // { dg-options "-ftrack-macro-expansion=0" }
4 #define SA(X) static_assert (X, #X)
6 struct A
8   int i;
9   constexpr A(int _i) { i = _i; } // { dg-error "empty body|A::i" }
12 template <class T>
13 struct B
15   T t;
16   constexpr B(T _t): t(_t) { }
19 B<int> b(1);                   // { dg-message "not declared .constexpr" }
20 SA(b.t==1);                     // { dg-error "non-constant condition|'b'" }
21 constexpr B<int> b2(1);
22 SA(b2.t==1);
24 template <class T>
25 constexpr T f(T a, T b)
27   typedef T myT;
28   return a + b;
31 SA(f(1,2)==3);