================
@@ -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:

> The return value isn't always ignored in our fork.

Just saw this comment; I think it’s fine to keep the return value then, but I’m 
not sure we want to copy-paste the same comment across like 4 different calls 
to this function. Having it in one location where it’s maybe the least 
self-evident seems fine, but I think we generally want to eschew code 
duplication, even if it’s just a comment and not code.

Some places have (or at one point had) a cast to `void`; that I think we can 
remove everywhere.

https://github.com/llvm/llvm-project/pull/106321
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to