aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/DeclarationFragments.cpp
diff options
context:
space:
mode:
authorDaniel Grumberg <dgrumberg@apple.com>2024-10-02 11:14:27 +0100
committerGitHub <noreply@github.com>2024-10-02 11:14:27 +0100
commit33fa40cc9659b7b56a9b440edc0587ff58793cac (patch)
treea049e55aba2211cfa1ae9f529a41aeedd67fae08 /clang/lib/ExtractAPI/DeclarationFragments.cpp
parente6bf48d11047e970cb24554a01b65b566d6b5d22 (diff)
downloadllvm-33fa40cc9659b7b56a9b440edc0587ff58793cac.zip
llvm-33fa40cc9659b7b56a9b440edc0587ff58793cac.tar.gz
llvm-33fa40cc9659b7b56a9b440edc0587ff58793cac.tar.bz2
[clang][ExtractAPI] Generate subheading for typedef'd anonymous types (#110689)
When an anonymous type has a typedef we normally use the typedef's name in places where we expect a named identifier in the symbol graph. This extends this logic to apply to subheadings. rdar://136690614
Diffstat (limited to 'clang/lib/ExtractAPI/DeclarationFragments.cpp')
-rw-r--r--clang/lib/ExtractAPI/DeclarationFragments.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp
index 9cb45c8..66c0386 100644
--- a/clang/lib/ExtractAPI/DeclarationFragments.cpp
+++ b/clang/lib/ExtractAPI/DeclarationFragments.cpp
@@ -1621,6 +1621,9 @@ DeclarationFragmentsBuilder::getSubHeading(const NamedDecl *Decl) {
cast<CXXMethodDecl>(Decl)->isOverloadedOperator()) {
Fragments.append(Decl->getNameAsString(),
DeclarationFragments::FragmentKind::Identifier);
+ } else if (isa<TagDecl>(Decl) &&
+ cast<TagDecl>(Decl)->getTypedefNameForAnonDecl()) {
+ return getSubHeading(cast<TagDecl>(Decl)->getTypedefNameForAnonDecl());
} else if (Decl->getIdentifier()) {
Fragments.append(Decl->getName(),
DeclarationFragments::FragmentKind::Identifier);