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
20 int global_function_0 () {
23 struct00 global_function_1 () {
28 int struct0_member_function_0 () {
31 struct0 struct0_member_function_1 () {
37 int struct1_member_function_0 ();
39 struct1 struct1_member_function_1 ();
43 int struct1_member_function_0 () {
46 struct1 struct1::struct1_member_function_1 () {
49 int main () { return 0; }