================
@@ -70,11 +70,13 @@ QualType APValue::LValueBase::getType() const {
     // constexpr int *p = &arr[1]; // valid?
     //
     // For now, we take the most complete type we can find.
-    for (auto *Redecl = cast<ValueDecl>(D->getMostRecentDecl()); Redecl;
+    for (auto *Redecl = cast<ValueDecl>(D->getMostRecentDecl());
+         Redecl && !Redecl->isInvalidDecl();
----------------
shafik wrote:

We are dealing with ill-formed code here. So there is not "right answer", 
right? Are you saying that we might misdiagnose an error?

Or are you saying the original code is incorrect and you think there is 
well-formed code we will not do the correct thing on?

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

Reply via email to