c++: constantness of call to function pointer [PR111703]
[official-gcc.git] / gcc / testsuite / g++.dg / diagnostic / constexpr4.C
blobf37c01cac55abf140f44f16fc6070d21055ea6da
1 // Verify we diagnose a call to a non-constant function pointer ahead of time.
2 // { dg-do compile { target c++11 } }
4 bool (*f)(int);
6 template<int N>
7 void g() {
8   static_assert(f(N), ""); // { dg-error "non-constant|'f' is not usable" }