ipa-cp: Perform operations in the appropriate types (PR 118097)
[gcc.git] / gcc / testsuite / g++.dg / template / fn-ptr3b.C
blob899c355fb386d95f30d2d03d8ace554bb7c04f4a
1 // PR c++/53164
2 // PR c++/105848
3 // A C++20 version of fn-ptr3a.C using class NTTPs.
4 // { dg-do compile { target c++20 } }
6 template<class T>
7 void f(T) { T::fail; } // { dg-error "fail" }
9 struct B_int { void (*P)(int); };
10 struct B_char { void (&P)(char); };
12 template<B_int B>
13 struct A {
14   // B.P not called
17 template<B_char B>
18 void wrap() {
19   // B.P not called
22 template<int>
23 void g() {
24   A<B_int{f}> a; // { dg-message "required from" }
25   wrap<B_char{f}>(); // { dg-message "required from" }
28 int main() {
29   g<0>();