aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.other/defarg9.C
blob: 440f3a2705c36b878eea44da522271b928298ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// { dg-do assemble  }
// 
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 April 2001 <nathan@codesourcery.com>

// Bug 2608. A default parameter introduced in the definition of a
// ctor never made it into the clones, leading to later overload
// resolution failures. This is related to bug 2356.

struct A
{
  A (int, int);
};

A::A (int d, int = 0)
{
  if (d)
    {
      A a (0);
    }
}

void get_width ()
{
  A a (1);
}

struct B : A
{
  B ();
};
B::B ()
  :A (1)
{
}

struct C : virtual A
{
  C (int, int);
};
C::C (int, int = 0)
  :A (1)
{
}
struct D: C
{
  D ();
};
D::D ()
  :A (0), C (0)
{
}