FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / ctors9.C
blob88ff255cc7583c9a202335fafef7da25e7856cd6
1 // Build don't link: 
2 // Special g++ Options: -pedantic-errors
3 // GROUPS passed constructors
4 // ctors file
5 // Message-Id: <9301132030.AA05210@cs.rice.edu>
6 // From: dougm@cs.rice.edu (Doug Moore)
7 // Subject: 2.3.3: accepts ctor-less derived class of ctor-ful base class
8 // Date: Wed, 13 Jan 93 14:30:21 CST
9 // Note: It gives an error now.  But not a very good one.
11 struct Foo
13   Foo(int aa);
14   int a;
15   const Foo* operator-> () const {return this;}
18 Foo::Foo(int aa)
19 :a(aa)
20 { }
23 struct var_Foo: public Foo
24 { // ERROR -  base.*// ERROR -  in class.*
25   var_Foo* operator-> () {return this;}
28 int blort(Foo& f)
30   return f->a;
33 int main()
35   var_Foo b(2);// ERROR - 
36   b->a = 0;
37   int x = blort(b);
38   return x;