OSDN Git Service

* c-typeck.c (common_type): push and pop binding level around
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900407_01.C
1 // g++ 1.37.1 bug 900407_01
2
3 // g++ fails to flag errors for uses of anachronistic features such as the
4 // invocation of a base class constructor in a ctor-initializer list without
5 // explicitly giving its name.
6
7 // Errors should probably be issued for such usage unless the -traditional
8 // option is used.
9
10 // Warnings are however issued.
11
12 // Cfront 2.0 flags such usage as an error when the +p (pure-language) option
13 // is used.
14
15 // Cfront 2.0 passes this test.
16
17 // keywords: anachronism, inheritance, initialization, mem-initializer
18
19 struct s0 {
20   int member;
21
22   s0 ();
23 };
24
25 s0::s0() { }
26
27 struct s1 : public s0 {
28   int member;
29
30   s1 ();
31 };
32
33 s1::s1() : () {         // ERROR - anachronism used
34 }
35
36 int main () { return 0; }