Why does the following compile in GCC 4.8 (g++)? Isn\'t it completely ill-formed?
g++
void test(int x) { return test(3); } int main() {}
That's allowed by the standard (§6.6.3/3)
A return statement with an expression of type void can be used only in functions with a return type of cv void; the expression is evaluated just before the function returns to its caller.