2 // { dg-do compile { target c++20 } }
5 constexpr S () : s (0) {}
6 consteval int foo () { return 1; }
7 virtual consteval int bar () { return 2; }
11 consteval int foo () { return 42; }
14 bar (int (*fn) () = &foo)
20 baz (int (S::*fn) () = &S::foo)
27 qux (int (S::*fn) () = &S::bar)
33 static_assert (bar () == 42);
34 static_assert (baz () == 1);
35 static_assert (qux () == 2);