[Bug c++/15742] New: 'noreturn' attribute ignored in method of template functions.
carlo at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon May 31 21:34:00 GMT 2004
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
More information about the Gcc-bugs
mailing list