[Bug c++/60364] [[noreturn]] specified for second declaration but not first doesn't result in a diagnostic
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 16 23:28:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60364
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
Known to fail| |4.9.3, 5.3.0, 6.2.0, 7.0
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Today's trunk of GCC 7.0 still accepts the code. Clang rejects it as expected:
$ clang++ -S -Wall -Wextra -Wpedantic -std=c++14 t.C
t.C:3:13: error: function declared '[[noreturn]]' after its first declaration
void func [[noreturn]] ();
^
t.C:1:6: note: declaration missing '[[noreturn]]' attribute is here
void func ();
^
1 error generated.
More information about the Gcc-bugs
mailing list