llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Chenyang Gao (cygao90) <details> <summary>Changes</summary> See #<!-- -->69468. --- Full diff: https://github.com/llvm/llvm-project/pull/75131.diff 1 Files Affected: - (modified) clang/lib/AST/APValue.cpp (+3-1) ``````````diff diff --git a/clang/lib/AST/APValue.cpp b/clang/lib/AST/APValue.cpp index 4eae308ef5b34c..648540c42b3e75 100644 --- a/clang/lib/AST/APValue.cpp +++ b/clang/lib/AST/APValue.cpp @@ -70,8 +70,10 @@ 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(); Redecl = cast_or_null<ValueDecl>(Redecl->getPreviousDecl())) { + D = Redecl; QualType T = Redecl->getType(); if (!T->isIncompleteArrayType()) return T; `````````` </details> https://github.com/llvm/llvm-project/pull/75131 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits