[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
Thu Oct 24 08:15:43 PDT 2024


================
@@ -8238,6 +8246,15 @@ ExprResult InitializationSequence::Perform(Sema &S,
         }
       }
 
+      // Note the return value isn't used to return early so that additional
+      // diagnostics can be emitted and to preserve the AST as best as possible
+      // even though an error might have occurred. For struct initialization it
+      // also allows all field assignments to be checked rather than bailing on
+      // the first error.
+      (void)S.BoundsSafetyCheckInitialization(
----------------
delcypher wrote:

The comment is explaining why we aren't checking the return value. If you remove it isn't obvious at all why its being ignored.

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


More information about the cfe-commits mailing list