aports/testing/c2rust/0003-fix-compilation-with-llvm20.patch
2025-03-16 16:26:15 +00:00

20 lines
926 B
Diff

Adapts call side to the API change in LLVM20 of
`unsigned int clang::FieldDecl::getBitWidthValue() const`
--- a/c2rust-ast-exporter/src/AstExporter.cpp 2025-02-24 14:19:52.000000000 +0100
+++ b/c2rust-ast-exporter/src/AstExporter.cpp 2025-03-14 09:39:10.440335997 +0100
@@ -2209,7 +2209,14 @@ class TranslateASTVisitor final
// 2. Encode bitfield width if any
if (D->isBitField()) {
cbor_encode_uint(
- array, D->getBitWidthValue(*this->Context));
+ array,
+
+#if CLANG_VERSION_MAJOR >= 20
+ D->getBitWidthValue()
+#else
+ D->getBitWidthValue(*this->Context)
+#endif
+ );
} else {
cbor_encode_null(array);
};