public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14407] New: __noreturn__ is not honnored in template functions
@ 2004-03-03 14:17 gcc-bugzilla at gcc dot gnu dot org
2004-03-03 15:12 ` [Bug c++/14407] " akim at epita dot fr
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-03-03 14:17 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]
The following example is quite clear enough. Note that the failure is
on the template function, not on the regular function.
/tmp % eof foo.cc nostromo 15:16
: -------------------- foo.cc ----------------------
cat > foo.cc << \EOF
void die () __attribute__ ((__noreturn__));
int
passes ()
{
die ();
}
template <class T>
int
fails ()
{
die ();
}
EOF
: ------------------------------------------------------------
/tmp % g++-3.2 -Wall foo.cc -c
/tmp % g++-3.3 -Wall foo.cc -c
/tmp % g++-3.4 -Wall foo.cc -c
foo.cc: In function `int fails()':
foo.cc:14: AVERTISSEMENT: pas de déclaration « return » dans la fonction retournant un non void
/tmp % LANG=C g++-3.4 -Wall foo.cc -c
foo.cc: In function `int fails()':
foo.cc:14: warning: no return statement in function returning non-void
Environment:
System: Linux nostromo 2.4.22 #1 SMP mer sep 17 19:49:48 CEST 2003 i686 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure
How-To-Repeat:
See above.
------- Additional Comments From akim at lrde dot epita dot fr 2004-03-03 14:17 -------
Fix:
Dunno :)
--
Summary: __noreturn__ is not honnored in template functions
Product: gcc
Version: 3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: akim 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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14407
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14407] __noreturn__ is not honnored in template functions
2004-03-03 14:17 [Bug c++/14407] New: __noreturn__ is not honnored in template functions gcc-bugzilla at gcc dot gnu dot org
@ 2004-03-03 15:12 ` akim at epita dot fr
2004-03-03 16:18 ` bangerth at dealii dot org
2004-07-13 16:58 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: akim at epita dot fr @ 2004-03-03 15:12 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From akim at epita dot fr 2004-03-03 15:12 -------
Subject: Re: New: __noreturn__ is not honnored in template
functions
>>> "gcc-bugzilla" == gcc-bugzilla at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org> writes:
> : -------------------- foo.cc ----------------------
> cat > foo.cc << \EOF
> void die () __attribute__ ((__noreturn__));
> int
> passes ()
> {
> die ();
> }
> template <class T>
> int
> fails ()
> {
> die ();
> }
> EOF
> : ------------------------------------------------------------
> /tmp % LANG=C g++-3.4 -Wall foo.cc -c
> foo.cc: In function `int fails()':
> foo.cc:14: warning: no return statement in function returning non-void
Sorry about the noise. It turns out my environment is not what I
believed it was: g++-3.4 was old, and using a more recent 3.4, the
test passes as expected. I apologize for the waste of time and
bandwidth :(
~/src/tc % /usr/lib/gcc-snapshot/bin/g++ --version
g++ (GCC) 3.4.0 20040215 (prerelease)
Copyright (C) 2004 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS
GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.
/tmp % /usr/lib/gcc-snapshot/bin/g++ -c foo.cc
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14407
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14407] __noreturn__ is not honnored in template functions
2004-03-03 14:17 [Bug c++/14407] New: __noreturn__ is not honnored in template functions gcc-bugzilla at gcc dot gnu dot org
2004-03-03 15:12 ` [Bug c++/14407] " akim at epita dot fr
@ 2004-03-03 16:18 ` bangerth at dealii dot org
2004-07-13 16:58 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: bangerth at dealii dot org @ 2004-03-03 16:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-03-03 16:18 -------
Apparently fixed in the meantime.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14407
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/14407] __noreturn__ is not honnored in template functions
2004-03-03 14:17 [Bug c++/14407] New: __noreturn__ is not honnored in template functions gcc-bugzilla at gcc dot gnu dot org
2004-03-03 15:12 ` [Bug c++/14407] " akim at epita dot fr
2004-03-03 16:18 ` bangerth at dealii dot org
@ 2004-07-13 16:58 ` reichelt at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-07-13 16:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-07-13 16:58 -------
The bug reappeared in 3.4.0, but was fixed for 3.4.1.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.4.1
Version|3.1 |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14407
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-07-13 16:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03 14:17 [Bug c++/14407] New: __noreturn__ is not honnored in template functions gcc-bugzilla at gcc dot gnu dot org
2004-03-03 15:12 ` [Bug c++/14407] " akim at epita dot fr
2004-03-03 16:18 ` bangerth at dealii dot org
2004-07-13 16:58 ` reichelt 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).