[clang] [Clang] Throw error when calling atomic with pointer to zero size object (PR #91057)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue May 21 11:32:15 PDT 2024


================
@@ -8497,7 +8498,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
         << 0 << AdjustedNumArgs << static_cast<unsigned>(Args.size())
         << /*is non object*/ 0 << ExprRange;
     return ExprError();
-  } else if (Args.size() > AdjustedNumArgs) {
+  }
+  if (Args.size() > AdjustedNumArgs) {
----------------
AaronBallman wrote:

The change is correct per our coding standard, but is unrelated to the changes in your patch. I'd say you can land this specific change as an NFC commit if you'd like, but otherwise it should be backed out of this PR.

https://github.com/llvm/llvm-project/pull/91057


More information about the cfe-commits mailing list