diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 00ed1702..5377516f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,7 +31,6 @@ jobs: fail-fast: false matrix: language: ["cpp"] - compiler: [g++-11] buildmode: [Debug] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] # Learn more: @@ -54,14 +53,14 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install libcurl4-gnutls-dev ninja-build ${{matrix.compiler}} --no-install-recommends + sudo apt install build-essential ninja-build libssl-dev libcurl4-gnutls-dev cmake git ca-certificates gzip -y --no-install-recommends - name: Create Build Environment run: cmake -E make_directory ${{github.workspace}}/build - name: Configure CMake working-directory: ${{github.workspace}}/build - run: cmake -DCMAKE_BUILD_TYPE=${{matrix.buildmode}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -GNinja .. + run: cmake -DCMAKE_BUILD_TYPE=${{matrix.buildmode}} -GNinja .. - name: Build working-directory: ${{github.workspace}}/build @@ -75,4 +74,4 @@ jobs: # uses a compiled language - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v3 diff --git a/Dockerfile b/Dockerfile index b0959dd8..57ab2e8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:22.04 AS build # Install base & build dependencies, needed certificates for curl to work with https RUN apt update && \ apt upgrade -y && \ - apt install build-essential ninja-build libcurl4-gnutls-dev libssl-dev cmake git ca-certificates gzip -y --no-install-recommends + apt install build-essential ninja-build libssl-dev libcurl4-gnutls-dev cmake git ca-certificates gzip -y --no-install-recommends # Copy source files WORKDIR /app/src diff --git a/src/tech/include/cct_exception.hpp b/src/tech/include/cct_exception.hpp index d0f3bf34..4cf86a46 100644 --- a/src/tech/include/cct_exception.hpp +++ b/src/tech/include/cct_exception.hpp @@ -22,7 +22,7 @@ class exception : public std::exception { public: static constexpr int kMsgMaxLen = 80; - template = true> + template = true> explicit exception(const char (&str)[N]) noexcept { // Hint: default constructor constructs a variant holding the value-initialized value of the first alternative // (index() is zero). In our case, it's a std::array, which is what we want here. @@ -34,18 +34,10 @@ class exception : public std::exception { explicit exception(string&& str) noexcept(std::is_nothrow_move_constructible_v) : _data(std::move(str)) {} -#ifdef CCT_MSVC - // MSVC bug: https://developercommunity.visualstudio.com/t/using-fmtlib-on-a-custom-exceptions-constructor-pa/1673659 - // do not use fmt for building an exception waiting for the bug to be fixed... - // Exception message will be incorrect. - template - explicit exception(std::string_view fmt, Args&&...) : _data(std::in_place_type, fmt) {} -#else template explicit exception(format_string fmt, Args&&... args) : _data(std::in_place_type) { cct::format_to(std::back_inserter(std::get<1>(_data)), fmt, std::forward(args)...); } -#endif const char* what() const noexcept override { switch (_data.index()) { diff --git a/src/tech/include/cct_invalid_argument_exception.hpp b/src/tech/include/cct_invalid_argument_exception.hpp index 735cc82c..f0697c1d 100644 --- a/src/tech/include/cct_invalid_argument_exception.hpp +++ b/src/tech/include/cct_invalid_argument_exception.hpp @@ -2,7 +2,6 @@ #include -#include "cct_config.hpp" #include "cct_exception.hpp" #include "cct_format.hpp" #include "cct_string.hpp" @@ -15,15 +14,7 @@ class invalid_argument : public exception { explicit invalid_argument(string&& str) noexcept : exception(std::move(str)) {} -#ifdef CCT_MSVC - // MSVC bug: https://developercommunity.visualstudio.com/t/using-fmtlib-on-a-custom-exceptions-constructor-pa/1673659 - // do not use fmt for building an exception waiting for the bug to be fixed... - // Exception message will be incorrect. - template - explicit invalid_argument(std::string_view fmt, Args&&... args) : exception(fmt, std::forward(args)...) {} -#else template explicit invalid_argument(format_string fmt, Args&&... args) : exception(fmt, std::forward(args)...) {} -#endif }; } // namespace cct \ No newline at end of file