c++: constantness of call to function pointer [PR111703]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp2a / concepts-fn8.C
blobc63d26c931d9e3e7dbdca4b0ac74a715a98d0c25
1 // PR c++/111703
2 // { dg-do compile { target c++20 } }
4 template<class T>
5 constexpr bool always_true() { return true; }
7 struct P {
8   P() = default;
10   template<class T>
11     requires (always_true<T>()) // { dg-bogus "used before its definition" }
12   constexpr P(const T&) { }
14   int n, m;
17 void (*f)(P);
18 P (*h)(P);
20 template<class T>
21 constexpr bool g() {
22   P x;
23   f(x); // { dg-bogus "from here" }
24   f(h(x)); // { dg-bogus "from here" }
25   return true;