* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-array-ptr4.C
blob3dd3f34e67b3494cebb5443e3b98134234e96e31
1 // { dg-do compile { target c++11 } }
3 constexpr const int do_last(const int* x, int n) {
4  return x[n - 1];
7 struct IsNegative {
8   constexpr bool operator()(const int& x) {
9     return x < 0;
10   }
13 template<int N, class Pred>
14 constexpr bool has_neg(const int (&x)[N], Pred p) {
15   return p(do_last(x, N)); // Line 13
18 constexpr int a[] = {1, -2};
20 constexpr auto answer = has_neg(a, IsNegative{}); // Line 18
22 static_assert(answer, "Error");