summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/anon7.C
blob: 79cad0acb99bac6a1f38c6cae7eb32327621e31b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// PR c++/39560
// { dg-options -Wunused }

struct X { };

class Z {
public:
  X* cc(int c);
};

class F {
public:
  typedef X* (Z::*MethO)(int);
  typedef X* (F::*MethF)(int);
  template<MethO m>
  X* xwrapper(int i) {
    union {
      Z *z;
      F *f;
    };				// { dg-bogus "unused" }
    f = this;
    return ((z->*m)(i));
  }
};

F::MethF meth = &F::xwrapper<&Z::cc>;