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.
[EMAIL PROTECTED]:~/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
[EMAIL PROTECTED]:~/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
[EMAIL PROTECTED]:~/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