[all-commits] [llvm/llvm-project] d8352a: Diagnose use of _Noreturn on a struct/union field

Aaron Ballman via All-commits all-commits at lists.llvm.org
Fri Jul 29 10:19:00 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d8352abd3a4f411828dbe46c7dfd3e935ab4dd4a
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2022-07-29 (Fri, 29 Jul 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Parse/ParseDecl.cpp
    M clang/test/Parser/c11-noreturn.c

  Log Message:
  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

More information about the All-commits mailing list