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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [init/] [vbase1.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++/50618
2
// { dg-do run }
3
 
4
struct Base
5
{
6
    const int text;
7
    Base():text(1) {}
8
    Base(int aText)
9
    : text(aText) {}
10
};
11
struct SubA : public virtual Base
12
{
13
protected:
14
  int x;
15
public:
16
  SubA(int aX)
17
  : x(aX) {}
18
};
19
class SubB : public virtual Base
20
{};
21
struct Diamond : public SubA, public SubB
22
{
23
    Diamond(int text)
24
    : Base(text), SubA(5), SubB() {}
25
 
26
    void printText()
27
    {
28
        if(text != 2)
29
          __builtin_abort();
30
        if(x!=5)
31
          __builtin_abort();
32
    }
33
};
34
 
35
int main(int, char**)
36
{
37
    Diamond x(2);
38
    x.printText();
39
}

powered by: WebSVN 2.1.0

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