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++/15742] New: 'noreturn' attribute ignored in method of template functions.


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


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