Skip to content

Not compiling with LLVM 20.1.0 or later #1242

@shirok1

Description

@shirok1

See llvm/llvm-project#122289

  Cloning into 'tinycbor_build'...
  HEAD is now at d393c16 Parser: fix reading it->extra on big endian when bytesNeeded == 1
  /Users/shiroki/.cargo/git/checkouts/c2rust-2471865f8518dc65/0757fe4/c2rust-ast-exporter/src/AstExporter.cpp:2217:61: error: too many arguments to function call, expected 0, have 1
   2217 |                                  array, D->getBitWidthValue(*this->Context));
        |                                         ~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
  /opt/homebrew/Cellar/llvm/20.1.4_1/include/clang/AST/Decl.h:3166:12: note: 'getBitWidthValue' declared here
   3166 |   unsigned getBitWidthValue() const;
        |            ^
  /Users/shiroki/.cargo/git/checkouts/c2rust-2471865f8518dc65/0757fe4/c2rust-ast-exporter/src/AstExporter.cpp:2309:25: warning: enumeration value 'Binary' not handled in switch [-Wswitch]
   2309 |             switch (SL->getKind()) {
        |                     ~~~~^~~~~~~~~
  /Users/shiroki/.cargo/git/checkouts/c2rust-2471865f8518dc65/0757fe4/c2rust-ast-exporter/src/AstExporter.cpp:2309:25: note: add missing switch cases
   2309 |             switch (SL->getKind()) {
        |                         ^
  1 warning and 1 error generated.
  gmake[3]: *** [CMakeFiles/clangAstExporter.dir/build.make:79: CMakeFiles/clangAstExporter.dir/AstExporter.cpp.o] Error 1
  gmake[2]: *** [CMakeFiles/Makefile2:421: CMakeFiles/clangAstExporter.dir/all] Error 2
  gmake[1]: *** [CMakeFiles/Makefile2:428: CMakeFiles/clangAstExporter.dir/rule] Error 2
  gmake: *** [Makefile:254: clangAstExporter] Error 2

Simply removing *this->Context will make the compile success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildingBuild/compile errors or build system-related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions