15742 – [3.4/4.0 Regression] 'noreturn' attribute ignored in method of template functions. (original) (raw)
Description Carlo Wood 2004-05-31 01:57:09 UTC
The following code snippet:
extern void exit(int) attribute ((noreturn));
template 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::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.