This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26886] missing warning for no return statement in function returning non-void



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]