blob: 400612e756e6a7bb9636588955d49239c585a71d [file] [log] [blame]
/* { dg-do run } */
/* { dg-options "-O3 -fno-early-inlining" } */
class H
{
public:
virtual unsigned bar() const { return 16; }
};
class A : public H
{
unsigned foo(unsigned (H::*func)(void) const) const;
public:
H *h;
virtual unsigned bar() const;
};
unsigned A::foo(unsigned (H::*func)(void) const) const
{
return (h->*func)();
}
unsigned A::bar() const
{
return foo(&H::bar);
}
int main (int argc, char **argv)
{
H h;
A a;
a.h = &h;
if (a.bar() != 16)
__builtin_abort ();
return 0;
}