[clang] [clang][HeuristicResolver] Resolve more dependent member accesses (PR #223667)

Christian Kandeler via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 06:25:46 PDT 2026


================
@@ -136,8 +160,22 @@ TagDecl *HeuristicResolverImpl::resolveTypeToTagDecl(QualType QT) {
   T = T->getCanonicalTypeInternal().getTypePtr();
 
   if (const auto *DNT = T->getAs<DependentNameType>()) {
-    T = resolveDeclsToType(resolveDependentNameType(DNT), Ctx)
-            .getTypePtrOrNull();
+    auto Decls = resolveDependentNameType(DNT);
+    QualType Resolved = resolveDeclsToType(Decls, Ctx);
+    // `Resolved` is canonical, so if the name refers to a member typedef of a
+    // template parameter (as `vector<T>::allocator_type` does), it has lost the
+    // TemplateTypeParmDecl we would need to fall back to the parameter's
+    // default argument. Consult the typedef's underlying type as written
+    // instead.
+    if (Decls.size() == 1) {
----------------
ckandeler wrote:

Done.

https://github.com/llvm/llvm-project/pull/223667


More information about the cfe-commits mailing list