Debian Codegraph @

gcc/testsuite/g++.dg/diagnostic/constexpr4.C

raw
1 // Verify we diagnose a call to a non-constant function pointer ahead of time.
2 // { dg-do compile { target c++11 } }
3
4 bool (*f)(int);
5
6 template<int N>
7 void g() {
8 static_assert(f(N), ""); // { dg-error "non-constant|'f' is not usable" }
9 }