summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/ctors4.C
blob: 25f9c060729d59530414907a45945c7526ce6bc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do run  }
// { dg-options "-w" }
// GROUPS passed constructors
// ctors file
// Message-Id: <ACHILLES.92Nov25192123@i90s8.ira.uka.de>
// From: Alf-Christian Achilles <achilles@ira.uka.de>
// Subject: g++ 2.3.1 rejects initialization with object of derived class
// Date: 25 Nov 92 19:21:23

extern "C" int printf (const char *, ...);

class A {
public:
  virtual void foo() {};
};

class B : public A {
public:
  void foo() {};
};

main ()
{
  B b;
  A a = b;  //unjustified error: unexpected argument to constructor `A'
  printf ("PASS\n");
}