aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/ExtractAPI/DeclarationFragments.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/ExtractAPI/DeclarationFragments.cpp')
-rw-r--r--clang/lib/ExtractAPI/DeclarationFragments.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp
index 5234932..791afc1 100644
--- a/clang/lib/ExtractAPI/DeclarationFragments.cpp
+++ b/clang/lib/ExtractAPI/DeclarationFragments.cpp
@@ -1617,10 +1617,13 @@ DeclarationFragmentsBuilder::getFunctionSignature(const ObjCMethodDecl *);
DeclarationFragments
DeclarationFragmentsBuilder::getSubHeading(const NamedDecl *Decl) {
DeclarationFragments Fragments;
- if (isa<CXXConstructorDecl>(Decl) || isa<CXXDestructorDecl>(Decl))
+ if (isa<CXXConstructorDecl>(Decl)) {
Fragments.append(cast<CXXRecordDecl>(Decl->getDeclContext())->getName(),
DeclarationFragments::FragmentKind::Identifier);
- else if (isa<CXXConversionDecl>(Decl)) {
+ } else if (isa<CXXDestructorDecl>(Decl)) {
+ Fragments.append(cast<CXXDestructorDecl>(Decl)->getNameAsString(),
+ DeclarationFragments::FragmentKind::Identifier);
+ } else if (isa<CXXConversionDecl>(Decl)) {
Fragments.append(
cast<CXXConversionDecl>(Decl)->getConversionType().getAsString(),
DeclarationFragments::FragmentKind::Identifier);
@@ -1634,9 +1637,11 @@ DeclarationFragmentsBuilder::getSubHeading(const NamedDecl *Decl) {
} else if (Decl->getIdentifier()) {
Fragments.append(Decl->getName(),
DeclarationFragments::FragmentKind::Identifier);
- } else
+ } else {
Fragments.append(Decl->getDeclName().getAsString(),
DeclarationFragments::FragmentKind::Identifier);
+ }
+
return Fragments;
}