This code below wont generate a warning for function a(). Compiled with -Wall. If you remove the const from the return, it will work.
<code> class A { public: }; const A a() { } int main() { A b = a(); } </code> -- Summary: g++ doesnt report missing return if return is of type const <type> Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mfribeiro at gmail dot com GCC build triplet: x86_64 GNU/Linux GCC host triplet: x86_64 GNU/Linux GCC target triplet: x86_64 GNU/Linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40749