[clang] [clang][Sema] Fix crash on atomic builtins with incomplete type args (PR #96374)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 06:28:08 PDT 2024


================
@@ -4570,7 +4570,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
   }
 
   // Pointer to object of size zero is not allowed.
-  if (Context.getTypeInfoInChars(AtomTy).Width.isZero()) {
+  if (!AtomTy->isIncompleteType() &&
----------------
AaronBallman wrote:

If you call `RequireCompleteType()` before this `if` instead of checking for an incomplete type, do you get better diagnostic behavior?

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


More information about the cfe-commits mailing list