================
@@ -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();
----------------
erichkeane wrote:

The problem is that if the 'invalid' decl is the last one, we end up giving up 
on this loop entirely.  If the purpose here is to just skip an invalid decl, we 
probably need to skip JUST it, not all previous ones too.

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