Merge from trunk @ 138209
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / ctors5.C
blob1f469cf5d4945c2d2bcc97386aa4233889dd2e7e
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
8 class X
9 { // { dg-error "1: note:                 X::X\\(const X&\\)" } implicit constructor
10   private:
11     int x;
12   public:
13     static const X x0;
14     X( int );
17 class Y // { dg-error "1: error: new types may not be defined in a return type|1: note: \\(perhaps a semicolon is missing after the definition of 'Y'\\)" }
19   private:
20     X xx;
21   public:
22     Y();
24 X::X( int xi ) // { dg-error "14: error: return type specification for constructor invalid|14: note: candidates are: X::X\\(int\\)" }
26     x = xi;
29 const X X::x0( 0 );
31 Y::Y() // { dg-error "6: error: no matching function for call to 'X::X\\(\\)'" }
33     xx = X::x0;