view gcc/testsuite/g++.dg/lookup/anon7.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

// 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>;