[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 23 17:15:18 PDT 2024


================
@@ -13559,6 +13562,27 @@ QualType Sema::CheckAssignmentOperands(Expr *LHSExpr, ExprResult &RHS,
   QualType LHSType = LHSExpr->getType();
   QualType RHSType = CompoundType.isNull() ? RHS.get()->getType() :
                                              CompoundType;
+
+  if (RHS.isUsable()) {
+    // Even if this check fails don't return early to allow the best
+    // possible error recovery and to allow any subsequent diagnostics to
+    // work.
+    (void)BoundsSafetyCheckAssignmentToCountAttrPtr(
----------------
delcypher wrote:

It was to suppress any compiler that might want to warn about the return value being ignored.

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


More information about the cfe-commits mailing list