public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11725] New: Wrong return statement warning with -Wreturn-type in template class method
@ 2003-07-30 13:22 gcc-bugzilla at gcc dot gnu dot org
  2003-07-30 14:01 ` [Bug c++/11725] [3.4 Regression] " pinskia at physics dot uc dot edu
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-07-30 13:22 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-01-20 17:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-30 13:22 [Bug c++/11725] New: Wrong return statement warning with -Wreturn-type in template class method gcc-bugzilla at gcc dot gnu dot org
2003-07-30 14:01 ` [Bug c++/11725] [3.4 Regression] " pinskia at physics dot uc dot edu
2003-08-16 17:53 ` pinskia at gcc dot gnu dot org
2003-10-03 20:27 ` pinskia at gcc dot gnu dot org
2003-12-19  8:14 ` pinskia at gcc dot gnu dot org
2003-12-29 17:54 ` pinskia at gcc dot gnu dot org
2004-01-11 17:13 ` pinskia at gcc dot gnu dot org
2004-01-18 15:38 ` [Bug c++/11725] [3.4/3.5 " cvs-commit at gcc dot gnu dot org
2004-01-18 16:41 ` [Bug c++/11725] [3.4 " pinskia at gcc dot gnu dot org
2004-01-20 16:58 ` cvs-commit at gcc dot gnu dot org
2004-01-20 17:26 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).