[clang] [LifetimeSafety] Revamp how accesses and uses are handled (PR #225799)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 24 05:52:42 PDT 2026
================
@@ -3072,13 +3066,13 @@ namespace conditional_operator_control_flow {
#ifdef __cpp_exceptions
void throw_branches(bool cond, int *value) {
- (void)(cond ? throw 1 : value);
+ use((cond ? throw 1 : value));
(void)(cond ? throw 1 : throw 2);
}
void nested_throw_branches(bool cond, bool cond2, int *value) {
- (void)(cond ? (cond2 ? throw 1 : value) : throw 2);
- (void)(cond ? throw 1 : (cond2 ? value : throw 2));
+ use((cond ? (cond2 ? throw 1 : value) : throw 2));
+ use((cond ? throw 1 : (cond2 ? value : throw 2)));
----------------
usx95 wrote:
super nit: remove the extra brackets. Also migrate `(void)(cond ? throw 1 : throw 2);` away from `void`.
https://github.com/llvm/llvm-project/pull/225799
More information about the cfe-commits
mailing list