http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60364

            Bug ID: 60364
           Summary: [[noreturn]] specified for second declaration but not
                    first doesn't result in a diagnostic
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: filip.roseen at gmail dot com

Created attachment 32232
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32232&action=edit
testcase.cpp

void func ();

void func [[noreturn]] ();

int main () { }

------------------------------------------------------------------

The above should result in an error since [dcl.attr.noreturn]p1 explicitly
says;

  > The first declaration of a function shall specify the noreturn
  > attribute if any declaration of that function specifies the noreturn
  > attribute.

Both clang and icc correctly issues a diagnostic when trying to compile the
provided snippet.

Reply via email to