| 1 |
// { dg-do run } |
| 2 |
// { dg-options "-w" } |
| 3 |
// GROUPS passed constructors |
| 4 |
// ctors file |
| 5 |
// Message-Id: <[email protected]> |
| 6 |
// From: Alf-Christian Achilles <[email protected]> |
| 7 |
// Subject: g++ 2.3.1 rejects initialization with object of derived class |
| 8 |
// Date: 25 Nov 92 19:21:23 |
| 9 |
|
| 10 |
extern "C" int printf (const char *, ...); |
| 11 |
|
| 12 |
class A { |
| 13 |
public: |
| 14 |
virtual void foo() {}; |
| 15 |
}; |
| 16 |
|
| 17 |
class B : public A { |
| 18 |
public: |
| 19 |
void foo() {}; |
| 20 |
}; |
| 21 |
|
| 22 |
main () |
| 23 |
{ |
| 24 |
B b; |
| 25 |
A a = b; //unjustified error: unexpected argument to constructor `A' |
| 26 |
printf ("PASS\n"); |
| 27 |
} |
| 28 |
|