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

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 28 05:17:06 PDT 2024


================
@@ -8192,6 +8192,14 @@ ExprResult InitializationSequence::Perform(Sema &S,
             Kind.getRange().getEnd());
       } else {
         CurInit = new (S.Context) ImplicitValueInitExpr(Step->Type);
+        // Note the return value isn't used to return early
+        // 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.
+        S.BoundsSafetyCheckInitialization(Entity, Kind, Sema::AA_Initializing,
----------------
Sirraide wrote:

Not sure we really need this comment as that much is pretty much implied by discarding the return value (this comment is also duplicated somewhere else, which isn’t exactly ideal). I think we can just remove this?

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


More information about the cfe-commits mailing list