OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [expr/] [pr29066.C] - Rev 308

Go to most recent revision | Compare with Previous | Blame | View Log

// PR c++/29066
// Test pointer to member function comparison
// { dg-do run }

extern "C" void abort (void);

struct X
{
  virtual void a(void)=0;
};

struct Z : public X
{
  void a(void) {}
};


void f(X *obj)
{
  void (X::*xp)(void) = 0;
  void (X::*xp2)(void) = 0;

  xp = &X::a;

  if (xp == xp2)
    {
      abort(); 
    } 

  if (xp == 0)
    {
      abort();
    }
}

int main(int argc, char* argv[])
{
  Z myobj;

  f(&myobj);
  return 0;
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.