aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index da1eadd..f4314d0 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -1487,6 +1487,13 @@ static bool shouldBeHidden(NamedDecl *D) {
if (FD->isFunctionTemplateSpecialization())
return true;
+ // Hide destructors that are invalid. There should always be one destructor,
+ // but if it is an invalid decl, another one is created. We need to hide the
+ // invalid one from places that expect exactly one destructor, like the
+ // serialization code.
+ if (isa<CXXDestructorDecl>(D) && D->isInvalidDecl())
+ return true;
+
return false;
}