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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [conversion/] [ptrmem3.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Copyright (C) 2007 Free Software Foundation
2
// Contributed by Ollie Wild 
3
// { dg-do compile }
4
 
5
// Assorted pointer to member function static cast tests.
6
 
7
struct A { int f (); };
8
struct B : A { int f (); };
9
struct P : A { int f (); };
10
struct V { int f (); };
11
struct D : B, virtual V, private P { int f (); };
12
 
13
// Valid static casts.
14
int (B::*p1)() = static_cast(&D::f);
15
int (D::*p2)() = static_cast(&B::f);
16
 
17
// Virtual base class.
18
int (V::*p3)() = static_cast(&D::f);  // { dg-error "" }
19
int (D::*p4)() = static_cast(&V::f);  // { dg-error "" }
20
 
21
// Inaccessible base class.
22
int (P::*p5)() = static_cast(&D::f);  // { dg-error "" }
23
int (D::*p6)() = static_cast(&P::f);  // { dg-error "" }
24
 
25
// Ambiguous base class.
26
int (A::*p7)() = static_cast(&D::f);  // { dg-error "" }
27
int (D::*p8)() = static_cast(&A::f);  // { dg-error "" }
28
 
29
// Attempts to change member type.
30
float (B::*p13)() = static_cast(&D::f); // { dg-error "" }
31
float (D::*p14)() = static_cast(&B::f); // { dg-error "" }

powered by: WebSVN 2.1.0

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