Skip to content

Commit 8754fe3

Browse files
committed
fix build with clang 24
1 parent 665b520 commit 8754fe3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <clang/AST/ParentMapContext.h>
88
#include <clang/Basic/LangOptions.h>
99
#include <clang/Basic/SourceManager.h>
10+
#include <clang/Basic/Version.h>
1011
#include <llvm/ADT/DenseMap.h>
1112
#include <llvm/Support/ConvertUTF.h>
1213
#include <llvm/Support/ErrorHandling.h>
@@ -969,9 +970,12 @@ bool Converter::VisitCXXRecordDecl(clang::CXXRecordDecl *decl) {
969970
for (auto *method : decl->methods()) {
970971
if (IsComparisonOperator(method) && method->isDefaulted() &&
971972
!method->doesThisDeclarationHaveABody()) {
972-
sema_->DefineDefaultedComparison(
973-
decl->getLocation(), method,
974-
sema_->getDefaultedComparisonKind(method));
973+
#if CLANG_VERSION_MAJOR >= 23
974+
auto kind = method->getDefaultedComparisonKind();
975+
#else
976+
auto kind = sema_->getDefaultedComparisonKind(method);
977+
#endif
978+
sema_->DefineDefaultedComparison(decl->getLocation(), method, kind);
975979
}
976980
}
977981

0 commit comments

Comments
 (0)