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 () {
21 } // { dg-warning "no return" }
23 struct00 global_function_1 () {
24 } // { dg-warning "no return" }
28 int struct0_member_function_0 () {
29 } // { dg-warning "no return" }
31 struct0 struct0_member_function_1 () {
32 } // { dg-warning "no return" }
37 int struct1_member_function_0 ();
39 struct1 struct1_member_function_1 ();
43 int struct1_member_function_0 () {
44 } // { dg-warning "no return" }
46 struct1 struct1::struct1_member_function_1 () {
47 } // { dg-warning "no return" }
49 int main () { return 0; }