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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [expr/] [pr29066.C] - Blame information for rev 717

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/29066
2
// Test pointer to member function comparison
3
// { dg-do run }
4
 
5
extern "C" void abort (void);
6
 
7
struct X
8
{
9
  virtual void a(void)=0;
10
};
11
 
12
struct Z : public X
13
{
14
  void a(void) {}
15
};
16
 
17
 
18
void f(X *obj)
19
{
20
  void (X::*xp)(void) = 0;
21
  void (X::*xp2)(void) = 0;
22
 
23
  xp = &X::a;
24
 
25
  if (xp == xp2)
26
    {
27
      abort();
28
    }
29
 
30
  if (xp == 0)
31
    {
32
      abort();
33
    }
34
}
35
 
36
int main(int argc, char* argv[])
37
{
38
  Z myobj;
39
 
40
  f(&myobj);
41
  return 0;
42
}

powered by: WebSVN 2.1.0

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