Debian Codegraph @

gcc/testsuite/g++.dg/template/ptrmem23.C

raw
1 // PR c++/56247
2
3 struct Base {
4 void method() {}
5 };
6
7 typedef void (Base::*MemPtr)();
8
9 // Template with a member function pointer "non-type parameter".
10 template<MemPtr func>
11 struct Wrapper {};
12
13 template<class C>
14 struct Child : public Base {
15 // Templated derived class instantiates the Wrapper with the same parameter
16 // in two different virtual methods.
17 void foo() { typedef Wrapper<&Base::method> W; }
18 void bar() { typedef Wrapper<&Base::method> W; }
19 };
20
21 // Instantiate Child with some type.
22 template class Child<int>;