This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16784] New: Wrong warning : control reaches end of non-void function
- From: "sylvain dot pion at sophia dot inria dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jul 2004 16:08:11 -0000
- Subject: [Bug c++/16784] New: Wrong warning : control reaches end of non-void function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
g++ 3.5, with -Wall, emits a buggy warning for the code below.
g++ 3.4 works fine.
--------------------
struct A {
A() {}
~A() {}
};
int k()
{
A K;
bool b;
if ( b ) {
A G;
return 0;
}
else
return 0;
}
--------------------
spion@termite:~/GCC> ./Linux/bin/g++ -Wall -c warn_3_5.C
warn_3_5.C: In function `int k()':
warn_3_5.C:17: warning: control reaches end of non-void function
--
Summary: Wrong warning : control reaches end of non-void function
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sylvain dot pion at sophia dot inria dot fr
CC: gcc-bugs at gcc dot gnu dot org,sylvain dot pion at
sophia dot inria dot fr
GCC host triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16784