111
|
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 }
|
145
|
19 // { dg-error "1:return type specification for constructor invalid" "err" { target *-*-* } .-2 }
|
111
|
20 {
|
|
21 private:
|
|
22 X xx;
|
|
23 public:
|
|
24 Y();
|
|
25 }
|
145
|
26 X::X( int xi )
|
111
|
27 // { dg-message "1:X::X|candidate expects" "match candidate text" { target *-*-* } .-1 }
|
|
28 {
|
|
29 x = xi;
|
|
30 }
|
|
31
|
|
32 const X X::x0( 0 );
|
|
33
|
|
34 Y::Y() // { dg-error "6:no matching function for call to 'X::X\\(\\)'" }
|
|
35 {
|
|
36 xx = X::x0;
|
|
37 }
|