This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14407] New: __noreturn__ is not honnored in template functions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]