2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900205_03.C
blobb22172d104dfd45b6c253e3d0cd95f5f4e890571
1 // { dg-do assemble  }
2 // { dg-options "-Wreturn-type -pedantic-errors" }
3 // g++ 1.36.1 bug 900205_03
5 // Section 6.6.3 of the cfront 2.0 Reference Manual says "A return statement
6 // without an expression can be used only in functions that do not return
7 // a value, that is, a function with the return value type void..."
9 // Also in 6.6.3: "Flowing off the end of a function is equivalent to a
10 // return with no value; this is illegal in a value returning function."
12 // In contrast to the manual, g++ does not generate ERRORs for cases of
13 // "flowing off the end" of non-void functions.
15 // keywords: return statements, return type, void return, implicit return
18 struct struct00 { };
20 int global_function_0 () {
21 }                                       // { dg-error "" } 
23 struct00 global_function_1 () {
24 }                                       // { dg-error "" } 
26 struct struct0 {
28   int struct0_member_function_0 () {
29   }                                     // { dg-error "" } 
31   struct0 struct0_member_function_1 () {
32   }                                     // { dg-error "" } 
35 struct struct1 {
37   int struct1_member_function_0 ();
39   struct1 struct1_member_function_1 ();
43 int struct1_member_function_0 () {
44 }                                       // { dg-error "" } 
46 struct1 struct1::struct1_member_function_1 () {
47 }                                       // { dg-error "" } 
49 int main () { return 0; }