Skip to content

Commit

Permalink
Fix compilation issue with Clang 18
Browse files Browse the repository at this point in the history
  • Loading branch information
parcollet committed Apr 12, 2024
1 parent bce7d49 commit ce1883c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/plugins/c2py/matchers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,14 @@ namespace matchers {

// Filter some automatic instantiation from the compiler, and alike
if (!cls->getSourceRange().isValid()) return;
if (!cls->isCompleteDefinition()) return; // skip forward declaration.
if (cls->isLambda()) return; // no lambda
if (!cls->isCompleteDefinition()) return; // skip forward declaration.
if (cls->isLambda()) return; // no lambda

#if LLVM_VERSION_MAJOR < 18
if (not((cls->getTagKind() == clang::TTK_Struct) or (cls->getTagKind() == clang::TTK_Class))) return; // just struct and class
#else
if (not((cls->getTagKind() == clang::TagTypeKind::Struct) or (cls->getTagKind() == clang::TagTypeKind::Class))) return; // just struct and class
#endif

if (auto *s = llvm::dyn_cast_or_null<clang::ClassTemplateSpecializationDecl>(cls)) {
if (!s->getTypeAsWritten()) return;
Expand Down

0 comments on commit ce1883c

Please sign in to comment.