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