Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.old-deja / g++.law / ctors5.C
blob1776be949bb37e4a65467bb0ea9a05d2f5005872
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       // { dg-message "7:X::X|candidate expects" } implicit constructor
10   private:
11     int x;
12   public:
13     static const X x0;
14     X( int );
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 *-*-* } 17 }
20   private:
21     X xx;
22   public:
23     Y();
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 *-*-* } 25 }
28     x = xi;
31 const X X::x0( 0 );
33 Y::Y() // { dg-error "6:no matching function for call to 'X::X\\(\\)'" }
34 // { dg-message "candidate" "candidate note" { target *-*-* } 33 }
36     xx = X::x0;