2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / ctors4.C
blob25f9c060729d59530414907a45945c7526ce6bc2
1 // { dg-do run  }
2 // { dg-options "-w" }
3 // GROUPS passed constructors
4 // ctors file
5 // Message-Id: <ACHILLES.92Nov25192123@i90s8.ira.uka.de>
6 // From: Alf-Christian Achilles <achilles@ira.uka.de>
7 // Subject: g++ 2.3.1 rejects initialization with object of derived class
8 // Date: 25 Nov 92 19:21:23
10 extern "C" int printf (const char *, ...);
12 class A {
13 public:
14   virtual void foo() {};
17 class B : public A {
18 public:
19   void foo() {};
22 main ()
24   B b;
25   A a = b;  //unjustified error: unexpected argument to constructor `A'
26   printf ("PASS\n");