Skip to content

Commit

Permalink
Use dyn_node to try and workaround GCC issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que committed Jun 27, 2024
1 parent b556132 commit 02d61a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions clang/include/clang/ASTMatchers/ASTMatchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3980,9 +3980,13 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport,
PermittedToExport =
VD->hasGlobalStorage() && VD->getStorageClass() != SC_Static;
}
bool HasImportOrExportAttr =
Node.hasAttr<DLLImportAttr>() || Node.hasAttr<DLLExportAttr>();
return PermittedToExport && !HasImportOrExportAttr;
if (const Decl *D = dyn_cast<Decl>(&Node)) {
bool HasImportOrExportAttr =
D->hasAttr<DLLImportAttr>() || D->hasAttr<DLLExportAttr>();
return PermittedToExport && !HasImportOrExportAttr;
} else {
return false;
}
}

// @unreal: END
Expand Down

0 comments on commit 02d61a4

Please sign in to comment.