[PATCH] D140868: [C] Make (c ? e1 : e2) noreturn only if both e1 and e2 are noreturn
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 3 12:41:33 PST 2023
rjmccall added a comment.
LGTM, but I have a suggested elaboration for the comment.
================
Comment at: clang/lib/AST/ASTContext.cpp:10258
- // FIXME: some uses, e.g. conditional exprs, really want this to be 'both'.
- bool NoReturn = lbaseInfo.getNoReturn() || rbaseInfo.getNoReturn();
-
+ // For ConditionalOperator, the result type is noreturn if both operands are
+ // noreturn.
----------------
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