FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900205_03.C
blob4c352c87ae43b37b07a4412c788cc795fcbb97e3
1 // g++ 1.36.1 bug 900205_03
3 // Section 6.6.3 of the cfront 2.0 Reference Manual says "A return statement
4 // without an expression can be used only in functions that do not return
5 // a value, that is, a function with the return value type void..."
7 // Also in 6.6.3: "Flowing off the end of a function is equivalent to a
8 // return with no value; this is illegal in a value returning function."
10 // In contrast to the manual, g++ does not generate ERRORs for cases of
11 // "flowing off the end" of non-void functions.
13 // keywords: return statements, return type, void return, implicit return
15 // Special g++ Options: -Wreturn-type -pedantic-errors
17 struct struct00 { };
19 int global_function_0 () {
20 }                                       // ERROR - 
22 struct00 global_function_1 () {
23 }                                       // ERROR - 
25 struct struct0 {
27   int struct0_member_function_0 () {
28   }                                     // ERROR - 
30   struct0 struct0_member_function_1 () {
31   }                                     // ERROR - 
34 struct struct1 {
36   int struct1_member_function_0 ();
38   struct1 struct1_member_function_1 ();
42 int struct1_member_function_0 () {
43 }                                       // ERROR - 
45 struct1 struct1::struct1_member_function_1 () {
46 }                                       // ERROR - 
48 int main () { return 0; }