1 // { dg-do assemble }
2 // { dg-options "-fshow-column" }
3 // GROUPS passed constructors
4 // ctors file
5 // Subject: bug in handling static const object of the enclosing class
6 // Date: Tue, 1 Sep 92 10:38:44 EDT
7
8 class X // { dg-message "7:X::X|candidate expects" } implicit constructor
9 {
10 private:
11 int x;
12 public:
13 static const X x0;
14 X( int );
15 };
16
17 class Y // { dg-error "1:new types may not be defined in a return type" "err" }
18 // { dg-message "1:\\(perhaps a semicolon is missing after the definition of 'Y'\\)" "note" { target *-*-* } .-1 }
19 {
20 private:
21 X xx;
22 public:
23 Y();
24 }
X(int xi)25 X::X( int xi ) // { dg-error "14:return type specification for constructor invalid" "err" }
26 // { dg-message "1:X::X|candidate expects" "match candidate text" { target *-*-* } .-1 }
27 {
28 x = xi;
29 }
30
31 const X X::x0( 0 );
32
Y()33 Y::Y() // { dg-error "6:no matching function for call to 'X::X\\(\\)'" }
34 {
35 xx = X::x0;
36 }
37