Diagnose use of _Noreturn on a struct/union field
authorAaron Ballman <aaron@aaronballman.com>
Fri, 29 Jul 2022 17:16:10 +0000 (13:16 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 29 Jul 2022 17:18:44 +0000 (13:18 -0400)
commitd8352abd3a4f411828dbe46c7dfd3e935ab4dd4a
tree0c6bc0ba0e0d0c99bf3c8a6a201088e8d761690b
parentb9a662919344355d81f7eda4c8ebdd3d1ecd808c
Diagnose use of _Noreturn on a struct/union field

C99 6.7.4p2 clarifies that a function specifier can only be used in the
declaration of a function. _Noreturn is a function specifier, so it is
a constraint violation to write it on a structure or union field, but
we missed that case.

Fixes #56800
clang/docs/ReleaseNotes.rst
clang/lib/Parse/ParseDecl.cpp
clang/test/Parser/c11-noreturn.c