llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: None (smanna12) <details> <summary>Changes</summary> --- Full diff: https://github.com/llvm/llvm-project/pull/104811.diff 1 Files Affected: - (modified) clang/lib/Sema/SemaDecl.cpp (+5) ``````````diff diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 503e93f925713..a3cc211a67c72 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -13518,6 +13518,11 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { } Init = Result.getAs<Expr>(); + + // Assert that Init is non-null only if no errors have occurred. + assert((!Result.isInvalid() && Init) && + "Should have a valid initializer at this point"); + IsParenListInit = !InitSeq.steps().empty() && InitSeq.step_begin()->Kind == InitializationSequence::SK_ParenthesizedListInit; `````````` </details> https://github.com/llvm/llvm-project/pull/104811 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits