Skip to content

Commit

Permalink
Try to fix GCC parsing bug, and ignore CXXRecordDecls with ClassTempl…
Browse files Browse the repository at this point in the history
…ateDecl parent
  • Loading branch information
hach-que committed Jun 27, 2024
1 parent dd76fe2 commit 6912639
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ pythonenv*
/clang/utils/analyzer/projects/*/RefScanBuildResults
# automodapi puts generated documentation files here.
/lldb/docs/python_api/
.github/workflows/llvm.msi
.github/workflows/llvm.wixpdb
9 changes: 7 additions & 2 deletions clang/include/clang/ASTMatchers/ASTMatchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -3946,6 +3946,11 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport,
VarDecl)) {
bool PermittedToExport = false;
if (const CXXRecordDecl *CXXD = dyn_cast<CXXRecordDecl>(&Node)) {
if (isa<ClassTemplateDecl>(CXXD->getParent())) {
// This type declaration is part of a template, and therefore can not be
// exported.
return false;
}
if (const VarDecl *CXXDVD =
dyn_cast_or_null<VarDecl>(CXXD->getNextDeclInContext())) {
if (CXXDVD != nullptr &&
Expand Down Expand Up @@ -3974,8 +3979,8 @@ AST_POLYMORPHIC_MATCHER(isMissingDllImportOrExport,
PermittedToExport =
VD->hasGlobalStorage() && VD->getStorageClass() != SC_Static;
}
return PermittedToExport && (!Node.hasAttr<DLLImportAttr>()) &&
(!Node.hasAttr<DLLExportAttr>());
return PermittedToExport && (!(Node.hasAttr<DLLImportAttr>())) &&
(!(Node.hasAttr<DLLExportAttr>()));
}

// @unreal: END
Expand Down

0 comments on commit 6912639

Please sign in to comment.