diff --git a/clang/lib/AST/Interp/Context.cpp b/clang/lib/AST/Interp/Context.cpp index 2e5d721590edc6..d025586d91b7d3 100644 --- a/clang/lib/AST/Interp/Context.cpp +++ b/clang/lib/AST/Interp/Context.cpp @@ -134,13 +134,13 @@ std::optional Context::classify(QualType T) const { if (T->isReferenceType() || T->isPointerType()) return PT_Ptr; - if (auto *AT = dyn_cast(T)) + if (const auto *AT = dyn_cast(T)) return classify(AT->getValueType()); - if (auto *DT = dyn_cast(T)) + if (const auto *DT = dyn_cast(T)) return classify(DT->getUnderlyingType()); - if (auto *DT = dyn_cast(T)) + if (const auto *DT = dyn_cast(T)) return classify(DT->getPointeeType()); return {};