1// PR c++/56247
2
3struct Base {
4    void method() {}
5};
6
7typedef void (Base::*MemPtr)();
8
9// Template with a member function pointer "non-type parameter".
10template<MemPtr func>
11struct Wrapper {};
12
13template<class C>
14struct 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.
22template class Child<int>;
23