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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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 ` pinskia at physics dot uc dot edu
  2003-08-16 17:53 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-30 14:01 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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
           Priority|P3                          |P1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-30 14:01:44
               date|                            |
            Summary|Wrong return statement      |[3.4 Regression] Wrong
                   |warning with -Wreturn-type  |return statement warning
                   |in template class method    |with -Wreturn-type in
                   |                            |template class method
   Target Milestone|---                         |3.4


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-30 14:01 -------
I can confirm this on the mainline (20030730).
Fom Phil's Regression hunter: Search converges between 2002-12-17-trunk (#167) and 2002-12-
18-trunk (#168).  This is the time when the new parser came in.


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-16 17:53 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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |raimond_merkert at raytheon
                   |                            |dot com


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-08-16 17:53 -------
*** Bug 11939 has been marked as a duplicate of this bug. ***


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-03 20:27 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



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-03 20:27 -------
*** Bug 12504 has been marked as a duplicate of this bug. ***


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (2 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-19  8:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-19 08:05 -------
Actually I was wrong this is not caused by the new parser at all but rather this patch: <http://
gcc.gnu.org/ml/gcc-patches/2002-12/msg00944.html>. Jason you caused the regression, could 
you look into it?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (3 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-29 17:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (4 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-11 17:13 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-11 17:10 -------
Basically when processing templates, it should mark the functions as returns abnormally 
when using creating the throw, I will look into if Jason does not fix this regression soon.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


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

* [Bug c++/11725] [3.4/3.5 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (5 preceding siblings ...)
  2004-01-11 17:13 ` pinskia at gcc dot gnu dot org
@ 2004-01-18 15:38 ` 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
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-18 15:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-18 15:38 -------
Subject: Bug 11725

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jason@gcc.gnu.org	2004-01-18 15:38:08

Modified files:
	gcc/cp         : ChangeLog except.c 

Log message:
	PR c++/11725
	* except.c (build_throw): In a template, set
	current_function_returns_abnormally.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3894&r2=1.3895
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/except.c.diff?cvsroot=gcc&r1=1.164&r2=1.165



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (6 preceding siblings ...)
  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 ` 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
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-18 16:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-18 16:41 -------
Only a 3.4 regression now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.4/3.5 Regression] Wrong  |[3.4 Regression] Wrong
                   |return statement warning    |return statement warning
                   |with -Wreturn-type in       |with -Wreturn-type in
                   |template class method       |template class method


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (7 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-01-20 16:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-01-20 16:58 -------
Subject: Bug 11725

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	jason@gcc.gnu.org	2004-01-20 16:58:29

Modified files:
	gcc/cp         : ChangeLog except.c 

Log message:
	PR c++/11725
	* except.c (build_throw): In a template, set
	current_function_returns_abnormally.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.6&r2=1.3892.2.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/except.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.164&r2=1.164.4.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


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

* [Bug c++/11725] [3.4 Regression] Wrong return statement warning with -Wreturn-type in template class method
  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
                   ` (8 preceding siblings ...)
  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
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-20 17:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-20 17:26 -------
Fixed for 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11725


^ 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).