Skip to content

Commit

Permalink
Ignore CXXRecordDecls with ClassTemplateSpecializationDecl parent
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que committed Jun 27, 2024
1 parent 6912639 commit 25eb202
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clang/include/clang/ASTMatchers/ASTMatchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3946,7 +3946,8 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport,
VarDecl)) {
bool PermittedToExport = false;
if (const CXXRecordDecl *CXXD = dyn_cast<CXXRecordDecl>(&Node)) {
if (isa<ClassTemplateDecl>(CXXD->getParent())) {
if (isa<ClassTemplateDecl>(CXXD->getParent()) ||
isa<ClassTemplateSpecializationDecl>(CXXD->getParent())) {
// This type declaration is part of a template, and therefore can not be
// exported.
return false;
Expand Down Expand Up @@ -3979,8 +3980,9 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport,
PermittedToExport =
VD->hasGlobalStorage() && VD->getStorageClass() != SC_Static;
}
return PermittedToExport && (!(Node.hasAttr<DLLImportAttr>())) &&
(!(Node.hasAttr<DLLExportAttr>()));
bool HasImportOrExportAttr =
Node.hasAttr<DLLImportAttr>() || Node.hasAttr<DLLExportAttr>();
return PermittedToExport && !HasImportOrExportAttr;
}

// @unreal: END
Expand Down

0 comments on commit 25eb202

Please sign in to comment.