From 25eb202b7ea8ba02bd564b2bd02c6684e6832298 Mon Sep 17 00:00:00 2001 From: June Rhodes Date: Thu, 27 Jun 2024 16:01:38 +1000 Subject: [PATCH] Ignore CXXRecordDecls with ClassTemplateSpecializationDecl parent --- clang/include/clang/ASTMatchers/ASTMatchers.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h index 2320ed9eec7864..44c8b2829f447e 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -3946,7 +3946,8 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport, VarDecl)) { bool PermittedToExport = false; if (const CXXRecordDecl *CXXD = dyn_cast(&Node)) { - if (isa(CXXD->getParent())) { + if (isa(CXXD->getParent()) || + isa(CXXD->getParent())) { // This type declaration is part of a template, and therefore can not be // exported. return false; @@ -3979,8 +3980,9 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport, PermittedToExport = VD->hasGlobalStorage() && VD->getStorageClass() != SC_Static; } - return PermittedToExport && (!(Node.hasAttr())) && - (!(Node.hasAttr())); + bool HasImportOrExportAttr = + Node.hasAttr() || Node.hasAttr(); + return PermittedToExport && !HasImportOrExportAttr; } // @unreal: END