[PATCH] D140868: [C] Make (c ? e1 : e2) noreturn only if both e1 and e2 are noreturn

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 3 12:56:48 PST 2023


aaron.ballman added a comment.

C2x clarified the behavior of *standard* attributes when determining a composite type, and this particular case really straddles that boundary. We support `[[noreturn]]` and `_Noreturn` as standard attributes in C as well as `__attribute__((noreturn))` (as a nonstandard attribute with the same semantics as the standard attribute).

C2x 6.2.7p3 says, in part: "If one of the types has a standard attribute, the composite type also has that attribute." which is the current behavior before your patch. So this change introduces a regression for C2x for the standard attribute spelling but is fine for the GNU attribute spelling, but do we really want to have different answers depending on how the user spells the attribute? (FWIW, this change came in as part of the "unsequenced functions" attribute paper: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2956.htm).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140868/new/

https://reviews.llvm.org/D140868



More information about the cfe-commits mailing list