This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15742] New: 'noreturn' attribute ignored in method of template functions.
- From: "carlo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 May 2004 01:57:10 -0000
- Subject: [Bug c++/15742] New: 'noreturn' attribute ignored in method of template functions.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code snippet:
extern void exit(int) __attribute__ ((noreturn));
template<typename T>
struct A {
int find_cmp(void) { exit(1); }
};
When compiled with -Wall gives:
>g++-3.4.0 -Wall -c test.cc
test.cc: In member function `int A<T>::find_cmp()':
test.cc:5: warning: no return statement in function returning non-void
Also broken in 3.5.0 20040530 (today).
Warning does not occur with 3.3.3.
--
Summary: 'noreturn' attribute ignored in method of template
functions.
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: carlo at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15742