================
@@ -2411,10 +2411,15 @@ static bool 
CheckEvaluationResult(CheckEvaluationResultKind CERK,
                                   const FieldDecl *SubobjectDecl,
                                   CheckedTemporaries &CheckedTemps) {
   if (!Value.hasValue()) {
-    assert(SubobjectDecl && "SubobjectDecl shall be non-null");
-    Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << SubobjectDecl;
-    Info.Note(SubobjectDecl->getLocation(),
-              diag::note_constexpr_subobject_declared_here);
+    if (SubobjectDecl) {
----------------
hazohelet wrote:

I'm not worrying about `SubobjectLoc` that was used for `subobject declared 
here` note. https://reviews.llvm.org/D146358 introduced the explicit `nullptr` 
args, but it only happens on calls where invalid source location was explicitly 
passed before that patch. (There was one exception about base classes but it 
was fixed in https://reviews.llvm.org/D153969. Despite passing null 
`SubobjectDecl` there, the passed `APValue` is known to be `isStruct()`, so its 
subobjects do not inherit the nullness of `SubobjectDecl`)
So, we always had an invalid source location where we now have 
null`SubobjectDecl`; thus no information being lost.

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

Reply via email to