This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33752] New: gcc forgets about noreturn in this code
- From: "mec at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Oct 2007 16:07:19 -0000
- Subject: [Bug c++/33752] New: gcc forgets about noreturn in this code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the attached program, Beta::~Beta() is noreturn. gcc is smart enough to
figure out the noreturn in DeltaOne and DeltaTwo, but forgets about noreturn in
DeltaThree and issues an unwanted warning.
mec@hollerith:~/exp-non-void$ /home/mec/gcc-4.1.1/install/bin/g++ -Wall -c
z4.cc
z4.cc: In function 'bool DeltaTwo(bool)':
z4.cc:28: warning: unused variable 'b2'
z4.cc: In function 'bool DeltaThree(bool)':
z4.cc:42: warning: control reaches end of non-void function
mec@hollerith:~/exp-non-void$ /home/mec/gcc-4.2.1/install/bin/g++ -Wall -c
z4.cc
z4.cc: In function 'bool DeltaTwo(bool)':
z4.cc:28: warning: unused variable 'b2'
z4.cc: In function 'bool DeltaThree(bool)':
z4.cc:42: warning: control reaches end of non-void function
mec@hollerith:~/exp-non-void$ /home/mec/gcc-4.3-20070914/install/bin/g++ -Wall
-c z4.cc
z4.cc: In function 'bool DeltaTwo(bool)':
z4.cc:28: warning: unused variable 'b2'
z4.cc: In function 'bool DeltaThree(bool)':
z4.cc:42: warning: control reaches end of non-void function
--
Summary: gcc forgets about noreturn in this code
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mec at google dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33752