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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [inherit/] [covariant18.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/47873
2
// { dg-do run }
3
 
4
struct Base
5
{
6
    virtual ~Base(){}
7
 
8
    virtual Base& This() { return *this; }
9
};
10
 
11
 
12
struct Ent : virtual Base
13
{
14
    void *m_Body;
15
 
16
    Ent& This() { return *this; }
17
 
18
    virtual Ent& body()
19
    {
20
        return This();
21
    }
22
 
23
};
24
 
25
 
26
struct Msg : virtual Ent
27
{
28
    Msg()
29
    {
30
        body();
31
    }
32
 
33
    Msg& This() { return *this; }
34
};
35
 
36
int main()
37
{
38
    Msg m;
39
 
40
    return 0;
41
}

powered by: WebSVN 2.1.0

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