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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [dc6.C] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run { target c++11 } }
2
 
3
int a_ct;
4
 
5
struct A
6
{
7
  A(int i): i(i) { ++a_ct; }
8
  A(const A& a): i(a.i) { ++a_ct; }
9
  ~A() { --a_ct; }
10
  int i;
11
};
12
 
13
struct V
14
{
15
  V() { }
16
};
17
 
18
struct B: virtual V
19
{
20
  A a;
21
  B(A a): a(a) { }
22
  B(int i): B(A(i)) { }
23
};
24
 
25
struct C: B
26
{
27
  C(int i): B(i) { }
28
};
29
 
30
int main()
31
{
32
  {
33
    B b(42);
34
    C c(24);
35
    if (b.a.i != 42
36
        ||c.a.i != 24)
37
      __builtin_abort ();
38
  }
39
  return a_ct;
40
}

powered by: WebSVN 2.1.0

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