/cp
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-70265-1.C
blob902fe1defbdcefc00fc52c4357fea3fcbbd8b200
1 // PR c++/70265
2 // { dg-do compile { target c++14 } }
4 constexpr int
5 foo (int p)
7   int t = 0;
8   while (1)  // { dg-error "count exceeds" }
9     ;
10   return t;
13 static_assert (foo (1) == 0, "");  // { dg-error "non-constant|in .constexpr. expansion of " }