diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73da07d885..526514c60a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: build_linux: strategy: matrix: - compiler: [gcc, clang-16] + compiler: [ {c: gcc, cpp: g++}, {c: clang-16, cpp: clang++-16} ] runs-on: ubuntu-22.04 timeout-minutes: 32 @@ -40,7 +40,8 @@ jobs: uses: devcontainers/ci@v0.2 with: runCmd: | - export CC=${{ matrix.compiler }} + export CC=${{ matrix.compiler.c }} + export CXX=${{ matrix.compiler.cpp }} export TOOLCHAIN=$(pwd)/cmake/lld.toolchain.cmake diff --git a/include/vast/Util/Warnings.hpp b/include/vast/Util/Warnings.hpp index 543d604b6d..cb40b0845c 100644 --- a/include/vast/Util/Warnings.hpp +++ b/include/vast/Util/Warnings.hpp @@ -21,7 +21,8 @@ #define VAST_GCC_RELAX_WARNINGS \ _Pragma( "GCC diagnostic ignored \"-Wuseless-cast\"" ) \ _Pragma( "GCC diagnostic ignored \"-Wnull-dereference\"" ) \ - _Pragma( "GCC diagnostic ignored \"-Wmaybe-uninitialized\"" ) + _Pragma( "GCC diagnostic ignored \"-Wmaybe-uninitialized\"" ) \ + _Pragma( "GCC diagnostic ignored \"-Wduplicated-branches\"" ) #ifdef __clang__ #define VAST_RELAX_WARNINGS \ diff --git a/include/vast/repl/command.hpp b/include/vast/repl/command.hpp index fe0798e966..59511240d3 100644 --- a/include/vast/repl/command.hpp +++ b/include/vast/repl/command.hpp @@ -114,7 +114,7 @@ namespace vast::repl } else { using current = typename std::tuple_element< 0, params_storage >::type; - if constexpr (current::param_name == name) { + if constexpr (std::string_view(current::param_name) == name) { return util::head(params).value; } else { return get_param< name >(util::tail(params)); diff --git a/lib/vast/Dialect/HighLevel/HighLevelLinkage.cpp b/lib/vast/Dialect/HighLevel/HighLevelLinkage.cpp index 20b63d7320..38e8881755 100644 --- a/lib/vast/Dialect/HighLevel/HighLevelLinkage.cpp +++ b/lib/vast/Dialect/HighLevel/HighLevelLinkage.cpp @@ -250,7 +250,7 @@ namespace vast::hl { auto &actx = decl->getASTContext(); auto linkage = actx.GetGVALinkageForFunction(decl); - if (const auto *dtor = clang::dyn_cast< clang::CXXDestructorDecl >(decl)) { + if (/*const auto *dtor =*/ clang::dyn_cast< clang::CXXDestructorDecl >(decl)) { VAST_UNIMPLEMENTED; } diff --git a/lib/vast/Frontend/GenAction.cpp b/lib/vast/Frontend/GenAction.cpp index 668e6ea757..a8b963d61b 100644 --- a/lib/vast/Frontend/GenAction.cpp +++ b/lib/vast/Frontend/GenAction.cpp @@ -183,6 +183,7 @@ namespace vast::cc { case target_dialect::low_level: return "low_level"; case target_dialect::llvm: return "llvm"; } + VAST_UNREACHABLE("Unknown target dialect to string."); } void compile_via_vast(auto mod, mcontext_t *mctx) diff --git a/lib/vast/Translation/CodeGenDriver.cpp b/lib/vast/Translation/CodeGenDriver.cpp index 325c8d5b08..c912d3230d 100644 --- a/lib/vast/Translation/CodeGenDriver.cpp +++ b/lib/vast/Translation/CodeGenDriver.cpp @@ -236,7 +236,7 @@ namespace vast::cg VAST_UNIMPLEMENTED_MSG("codegen for multi version function"); } - if (const auto *method = llvm::dyn_cast< clang::CXXMethodDecl >(decl)) { + if (/*const auto *method =*/ llvm::dyn_cast< clang::CXXMethodDecl >(decl)) { VAST_UNIMPLEMENTED_MSG("cxx methods"); } diff --git a/lib/vast/Translation/CodeGenFunction.cpp b/lib/vast/Translation/CodeGenFunction.cpp index 6532258266..982c677d34 100644 --- a/lib/vast/Translation/CodeGenFunction.cpp +++ b/lib/vast/Translation/CodeGenFunction.cpp @@ -74,7 +74,7 @@ namespace vast::cg bool codegen_driver::may_drop_function_return(qual_type rty) const { // We can't just disard the return value for a record type with a complex // destructor or a non-trivially copyable type. - if (const auto *recorrd_type = rty.getCanonicalType()->getAs< clang::RecordType >()) { + if (/*const auto *record_type =*/ rty.getCanonicalType()->getAs< clang::RecordType >()) { VAST_UNIMPLEMENTED; } diff --git a/lib/vast/Translation/CodeGenStmtVisitor.cpp b/lib/vast/Translation/CodeGenStmtVisitor.cpp index 73603e48e8..c34350cdf9 100644 --- a/lib/vast/Translation/CodeGenStmtVisitor.cpp +++ b/lib/vast/Translation/CodeGenStmtVisitor.cpp @@ -104,6 +104,7 @@ namespace vast::hl case clang::PredefinedExpr::IdentKind::PrettyFunctionNoVirtual : return IdentKind::PrettyFunctionNoVirtual; } + VAST_UNREACHABLE( "unsupported ident kind" ); } } // namespace vast::hl diff --git a/lib/vast/Translation/Mangler.cpp b/lib/vast/Translation/Mangler.cpp index fa6d66e5dc..398f869fd1 100644 --- a/lib/vast/Translation/Mangler.cpp +++ b/lib/vast/Translation/Mangler.cpp @@ -11,7 +11,7 @@ namespace vast::cg // Some ABIs don't have constructor variants. Make sure that base and complete // constructors get mangled the same. - if (const auto *ctor = clang::dyn_cast< clang::CXXConstructorDecl >(canonical.getDecl())) { + if (/*const auto *ctor =*/ clang::dyn_cast< clang::CXXConstructorDecl >(canonical.getDecl())) { VAST_UNIMPLEMENTED_IF(!target_info.getCXXABI().hasConstructorVariants()); } diff --git a/tools/vast-repl/vast-repl.cpp b/tools/vast-repl/vast-repl.cpp index 727e3d705b..9be90c2252 100644 --- a/tools/vast-repl/vast-repl.cpp +++ b/tools/vast-repl/vast-repl.cpp @@ -57,7 +57,7 @@ namespace vast::repl while (!cli.exit()) { std::string cmd; - if (auto quit = linenoise::Readline("> ", cmd)) { + if (linenoise::Readline("> ", cmd)) { break; }