This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26886] missing warning for no return statement in function returning non-void
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2006 01:49:26 -0000
- Subject: [Bug c++/26886] missing warning for no return statement in function returning non-void
- References: <bug-26886-12417@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from bangerth at dealii dot org 2006-03-28 01:49 -------
It warns whenever foo:test1 is first compiled (i.e. on first use). If, for
example, you add this code
--------------
int main ()
{
foo f;
return f.test1();
}
--------------
then you get the warning you are expecting:
g/x> c++ -Wreturn-type -c x.cc
x.cc: In function `int test2()':
x.cc:17: warning: control reaches end of non-void function
x.cc: In member function `int foo::test1()':
x.cc:10: warning: control reaches end of non-void function
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26886