http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18969
--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- It works in clang: test.cc:3:16: error: void function 'foo' should not return a value [-Wreturn-type] void foo() { return 0; } ^ ~