[clang] [clang] NFC: remove leftover from injected class name redecl (PR #155959)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 28 18:58:08 PDT 2025
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/155959
The code being removed became non-functional when injected class names were removed from the redecl chain in 470c454a6176ef31474553e408c90f5ee630df89, but that commit didn't clean the code base out of all the workarounds for that state of affairs.
>From 1a6f0c641634082e82f64631ffea7ac72b7202e3 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov at gmail.com>
Date: Thu, 28 Aug 2025 22:34:58 -0300
Subject: [PATCH] [clang] NFC: remove leftover from injected class name redecl
The code being removed became non-functional when injected class names
were removed from the redecl chain in 470c454a6176ef31474553e408c90f5ee630df89,
but that commit didn't clean the code base out of all the workarounds
for that state of affairs.
---
clang/include/clang/AST/ASTNodeTraverser.h | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/clang/include/clang/AST/ASTNodeTraverser.h b/clang/include/clang/AST/ASTNodeTraverser.h
index d9dc8290b0e49..fe08d637a1e1d 100644
--- a/clang/include/clang/AST/ASTNodeTraverser.h
+++ b/clang/include/clang/AST/ASTNodeTraverser.h
@@ -649,21 +649,8 @@ class ASTNodeTraverser
template <typename SpecializationDecl>
void dumpTemplateDeclSpecialization(const SpecializationDecl *D) {
- for (const auto *RedeclWithBadType : D->redecls()) {
- // FIXME: The redecls() range sometimes has elements of a less-specific
- // type. (In particular, ClassTemplateSpecializationDecl::redecls() gives
- // us TagDecls, and should give CXXRecordDecls).
- auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
- if (!Redecl) {
- // Found the injected-class-name for a class template. This will be
- // dumped as part of its surrounding class so we don't need to dump it
- // here.
- assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
- "expected an injected-class-name");
- continue;
- }
- Visit(Redecl);
- }
+ for (const auto *Redecl : D->redecls())
+ Visit(cast<SpecializationDecl>(Redecl));
}
template <typename TemplateDecl>
More information about the cfe-commits
mailing list