This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11725] New: Wrong return statement warning with -Wreturn-type in template class method
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jul 2003 13:22:09 -0000
- Subject: [Bug c++/11725] New: Wrong return statement warning with -Wreturn-type in template class method
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725
Summary: Wrong return statement warning with -Wreturn-type in
template class method
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nicolas dot burrus at lrde dot epita dot fr
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
gcc 3.4 emits a wrong warning for methods in template class without
return call, even if the end of the method will never be reached.
Environment:
System: Linux ouagadougou 2.4.21 #1 Fri Jul 25 11:19:01 CEST 2003 i686 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../../lrde/ext/gcc/configure --prefix=/home/lrde/lrde/usr/gcc-3.4 --enable-languages=c,c++ : (reconfigured) : (reconfigured) ../../lrde/ext/gcc/configure --enable-languages=c,c++ --prefix=/home/lrde/lrde/usr/gcc-3.4 : (reconfigured) ../../lrde/ext/gcc/configure --enable-languages=c,c++ --prefix=/home/lrde/lrde/usr/gcc-3.4 : (reconfigured) : (reconfigured) /home/lrde/stud/burrus_n/work/lrde/ext/gcc/configure --prefix=~lrde/usr/gcc-3.4 --enable-languages=c,c++ : (reconfigured) /home/lrde/stud/burrus_n/work/lrde/ext/gcc/configure --prefix=~lrde/usr/gcc-3.4 --enable-languages=c,c++ : (reconfigured) /home/lrde/stud/burrus_n/work/lrde/ext/gcc/configure --prefix=~lrde/usr/gcc-3.4 --enable-languages=c,c++ : (reconfigured) /home/lrde/stud/burrus_n/work/lrde/ext/gcc/configure --prefix=/home/lrde/lrde/usr/gcc-3.4 --enable-languages=c,c++
How-To-Repeat:
Compile this code with -Wreturn-type:
template <class T>
struct A
{
int foo()
{
throw "Stop";
}
};
------- Additional Comments From nicolas dot burrus at lrde dot epita dot fr 2003-07-30 13:22 -------
Fix:
Add -Wno-return-type if you want to keep -W.