summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-09-16 16:58:29 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-09-16 16:58:29 +0000
commit16d6b3b3da62aa5baaf3c66c8d4e6f8c8f70aeb7 (patch)
tree6031356a30dab2c3c69c332095eb59f34b4e0961 /contrib/llvm-project/clang/lib/AST/DeclBase.cpp
parentceff9b9d2587c46759fd6fb312916d5748986918 (diff)
parente588341d487d7ec86b5282968e3223f8c0e6de27 (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/clang/lib/AST/DeclBase.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/AST/DeclBase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/DeclBase.cpp b/contrib/llvm-project/clang/lib/AST/DeclBase.cpp
index da1eadd9d931..f4314d0bd961 100644
--- a/contrib/llvm-project/clang/lib/AST/DeclBase.cpp
+++ b/contrib/llvm-project/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;
}