URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 338 |
// Copyright (C) 2007 Free Software Foundation
|
// Copyright (C) 2007 Free Software Foundation
|
// Contributed by Ollie Wild
|
// Contributed by Ollie Wild
|
// { dg-do compile }
|
// { dg-do compile }
|
|
|
// Assorted pointer to member function implicit cast tests.
|
// Assorted pointer to member function implicit cast tests.
|
|
|
struct A { int f (); };
|
struct A { int f (); };
|
struct B : A { int f (); };
|
struct B : A { int f (); };
|
struct P : A { int f (); };
|
struct P : A { int f (); };
|
struct V { int f (); };
|
struct V { int f (); };
|
struct D : B, virtual V, private P { int f (); };
|
struct D : B, virtual V, private P { int f (); };
|
|
|
// Valid.
|
// Valid.
|
int (D::*p1)() = &B::f;
|
int (D::*p1)() = &B::f;
|
|
|
// Derived class.
|
// Derived class.
|
int (B::*p2)() = &D::f; // { dg-error "" }
|
int (B::*p2)() = &D::f; // { dg-error "" }
|
|
|
// Virtual base class.
|
// Virtual base class.
|
int (D::*p3)() = &V::f; // { dg-error "" }
|
int (D::*p3)() = &V::f; // { dg-error "" }
|
|
|
// Inaccessible base class.
|
// Inaccessible base class.
|
int (D::*p4)() = &P::f; // { dg-error "" }
|
int (D::*p4)() = &P::f; // { dg-error "" }
|
|
|
// Ambiguous base class.
|
// Ambiguous base class.
|
int (D::*p5)() = &A::f; // { dg-error "" }
|
int (D::*p5)() = &A::f; // { dg-error "" }
|
|
|
// Different member type.
|
// Different member type.
|
float (D::*p6)() = &B::f; // { dg-error "" }
|
float (D::*p6)() = &B::f; // { dg-error "" }
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.