* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-array-ptr2.C
blob9218196220059d549132315857b1dc5299097bbc
1 // { dg-do compile { target c++11 } }
3 template<class T>
4 struct IsNegative {
5   int dummy; // Workaround for empty class problem
6   constexpr IsNegative() : dummy(0) {}
7   constexpr bool operator()(const T& x) {
8     return x < T(0);
9   }
12 template<class T, int N, class Pred>
13 constexpr bool has_neg(T (&x)[N], Pred p) {
14   return p(x[0]) || p(x[1]);
17 constexpr int a[] = {1, -2};
19 constexpr auto answer = has_neg(a, IsNegative<int>{}); // #1
21 static_assert(answer, "Error");