| 1 |
// { dg-do run } |
| 2 |
// GROUPS passed constructors |
| 3 |
// ctor file |
| 4 |
// Message-Id: <[email protected]> |
| 5 |
// From: [email protected] (Roland Knight ) |
| 6 |
// Subject: gcc 2.4.1 bug |
| 7 |
// Date: Wed, 2 Jun 1993 11:33:34 -0400 |
| 8 |
|
| 9 |
#include <stdio.h> |
| 10 |
#include <stdlib.h> |
| 11 |
#include <string.h> |
| 12 |
|
| 13 |
char stuff[50]; |
| 14 |
char *p = stuff; |
| 15 |
|
| 16 |
class A { |
| 17 |
public: |
| 18 |
A() { *p++ = 'A';} |
| 19 |
}; |
| 20 |
|
| 21 |
class B { |
| 22 |
public: |
| 23 |
B() { *p++ = 'B'; } |
| 24 |
}; |
| 25 |
|
| 26 |
class C : public A, public B { |
| 27 |
public: |
| 28 |
C() : B(), A() { *p++ = 'C'; } |
| 29 |
}; |
| 30 |
|
| 31 |
class D : public A, public B { |
| 32 |
public: |
| 33 |
D() : B() { *p++ = 'D'; } |
| 34 |
}; |
| 35 |
|
| 36 |
class E : public A, public B { |
| 37 |
public: |
| 38 |
E() { *p++ = 'E'; } |
| 39 |
}; |
| 40 |
|
| 41 |
|
| 42 |
int main() { |
| 43 |
C c; |
| 44 |
D d; |
| 45 |
E e; |
| 46 |
if (strncmp ("ABCABDABE", stuff, 9)) |
| 47 |
{ printf ("FAIL\n"); return 1; } |
| 48 |
else |
| 49 |
printf ("PASS\n"); |
| 50 |
} |