From 3a837f04749d674fd8db5fe9ca90e7875f64a21f Mon Sep 17 00:00:00 2001 From: DNKpp Date: Fri, 22 May 2026 18:04:43 +0200 Subject: [PATCH 01/10] ci: add gcc-16 and clang-22 to the build matrix --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2232df063..84f6e4bf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,28 @@ jobs: cxx_standard: ${{ fromJSON(needs.generate-base-matrix.outputs.cxx_versions) }} config: # clang + - prefix: "Ubuntu" + os: "ubuntu-latest" + container: + image: "ghcr.io/dnkpp/clang:22" + compiler: + name: "clang" + version: "22" + asan: true + cxx20_modules: true + + - prefix: "Ubuntu" + suffix: "/libc++" + os: "ubuntu-latest" + container: + image: "ghcr.io/dnkpp/clang:22" + compiler: + name: "clang" + version: "22" + only_cpptrace: true + libcxx: true + cxx20_modules: false + - prefix: "Ubuntu" os: "ubuntu-latest" container: @@ -87,7 +109,6 @@ jobs: compiler: name: "clang" version: "21" - asan: true cxx20_modules: true - prefix: "Ubuntu" @@ -209,6 +230,16 @@ jobs: only_cpptrace: true # gcc + - prefix: "Ubuntu" + os: "ubuntu-latest" + container: + image: "ghcr.io/dnkpp/gcc:16" + compiler: + name: "gcc" + version: "16" + asan: true + cxx20_modules: true + - prefix: "Ubuntu" os: "ubuntu-latest" container: @@ -216,7 +247,6 @@ jobs: compiler: name: "gcc" version: "15" - asan: true cxx20_modules: false # in theory, it should work but in practice it does not. - prefix: "Ubuntu" From e0867c761143d5627606173f0a81a1cdaed4a51b Mon Sep 17 00:00:00 2001 From: DNKpp Date: Fri, 22 May 2026 20:08:51 +0200 Subject: [PATCH 02/10] refactor: remove obsolete v2 sub-namespace --- include/mimic++/printing/type/Parser.hpp | 16 ++++++++-------- include/mimic++/printing/type/ParserState.hpp | 2 +- include/mimic++/printing/type/PrintType.hpp | 4 ++-- include/mimic++/printing/type/PrintVisitor.hpp | 2 +- test/unit-tests/printing/parser/BuiltinTypes.cpp | 2 +- .../printing/parser/ConversionFunctions.cpp | 2 +- .../unit-tests/printing/parser/FunctionTypes.cpp | 2 +- .../printing/parser/OperatorFunctions.cpp | 2 +- .../printing/parser/PointerDeclarations.cpp | 2 +- .../printing/parser/QualifiedTypes.cpp | 2 +- test/unit-tests/printing/parser/Unparsable.cpp | 1 + 11 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/mimic++/printing/type/Parser.hpp b/include/mimic++/printing/type/Parser.hpp index 1217ca010..f6ab585a6 100644 --- a/include/mimic++/printing/type/Parser.hpp +++ b/include/mimic++/printing/type/Parser.hpp @@ -23,7 +23,7 @@ #include #endif -namespace mimicpp::printing::type::parsing::v2 +namespace mimicpp::printing::type::parsing { class Transaction; @@ -1356,11 +1356,11 @@ namespace mimicpp::printing::type::parsing::v2 namespace mimicpp::printing::type { - MIMICPP_DETAIL_CONSTEXPR_PRETTY_TYPES std::optional parse_type(std::string_view const text) + MIMICPP_DETAIL_CONSTEXPR_PRETTY_TYPES std::optional parse_type(std::string_view const text) { lexing::NameLexer lexer{text}; - parsing::v2::TokenStream stream{lexer}; - if (std::optional typeId = parsing::v2::parse_type_id(stream); + parsing::TokenStream stream{lexer}; + if (std::optional typeId = parsing::parse_type_id(stream); typeId && stream.is_eof()) { @@ -1370,16 +1370,16 @@ namespace mimicpp::printing::type return std::nullopt; } - MIMICPP_DETAIL_CONSTEXPR_PRETTY_TYPES std::optional parse_function(std::string_view const text) + MIMICPP_DETAIL_CONSTEXPR_PRETTY_TYPES std::optional parse_function(std::string_view const text) { lexing::NameLexer lexer{text}; - parsing::v2::TokenStream stream{lexer}; - if (std::optional functionId = parsing::v2::parse_function(stream)) + parsing::TokenStream stream{lexer}; + if (std::optional functionId = parsing::parse_function(stream)) { if (stream.is_eof() // Sometimes certain template details are added in separate square-brackets || (text.ends_with(']') - && parsing::v2::expect(stream, lexing::operator_or_punctuator{"["}))) + && parsing::expect(stream, lexing::operator_or_punctuator{"["}))) { return functionId; } diff --git a/include/mimic++/printing/type/ParserState.hpp b/include/mimic++/printing/type/ParserState.hpp index 078b9e714..4efa144ba 100644 --- a/include/mimic++/printing/type/ParserState.hpp +++ b/include/mimic++/printing/type/ParserState.hpp @@ -22,7 +22,7 @@ #include #endif -namespace mimicpp::printing::type::parsing::v2::state +namespace mimicpp::printing::type::parsing::state { struct TypeId; diff --git a/include/mimic++/printing/type/PrintType.hpp b/include/mimic++/printing/type/PrintType.hpp index 0bdc91180..b8f8a1f1f 100644 --- a/include/mimic++/printing/type/PrintType.hpp +++ b/include/mimic++/printing/type/PrintType.hpp @@ -131,7 +131,7 @@ namespace mimicpp::printing::type { if (std::optional const typeId = parse_type(name)) { - parsing::v2::PrintVisitor visitor{std::move(out)}; + parsing::PrintVisitor visitor{std::move(out)}; visitor.visit(*typeId); return visitor.out(); @@ -145,7 +145,7 @@ namespace mimicpp::printing::type { if (std::optional const functionId = parse_function(name)) { - parsing::v2::PrintVisitor visitor{std::move(out)}; + parsing::PrintVisitor visitor{std::move(out)}; visitor.visit(*functionId); return visitor.out(); diff --git a/include/mimic++/printing/type/PrintVisitor.hpp b/include/mimic++/printing/type/PrintVisitor.hpp index 03905f9fe..91d254d2e 100644 --- a/include/mimic++/printing/type/PrintVisitor.hpp +++ b/include/mimic++/printing/type/PrintVisitor.hpp @@ -19,7 +19,7 @@ #include #endif -namespace mimicpp::printing::type::parsing::v2 +namespace mimicpp::printing::type::parsing { template class PrintVisitor diff --git a/test/unit-tests/printing/parser/BuiltinTypes.cpp b/test/unit-tests/printing/parser/BuiltinTypes.cpp index 7352ab2be..dd0eb85b2 100644 --- a/test/unit-tests/printing/parser/BuiltinTypes.cpp +++ b/test/unit-tests/printing/parser/BuiltinTypes.cpp @@ -9,7 +9,7 @@ using mimicpp::printing::type::parse_type; namespace lexing = mimicpp::printing::type::lexing; -namespace state = mimicpp::printing::type::parsing::v2::state; +namespace state = mimicpp::printing::type::parsing::state; namespace { diff --git a/test/unit-tests/printing/parser/ConversionFunctions.cpp b/test/unit-tests/printing/parser/ConversionFunctions.cpp index 1c7a1711e..c8474456a 100644 --- a/test/unit-tests/printing/parser/ConversionFunctions.cpp +++ b/test/unit-tests/printing/parser/ConversionFunctions.cpp @@ -9,7 +9,7 @@ using mimicpp::printing::type::parse_type; namespace lexing = mimicpp::printing::type::lexing; -namespace state = mimicpp::printing::type::parsing::v2::state; +namespace state = mimicpp::printing::type::parsing::state; namespace { diff --git a/test/unit-tests/printing/parser/FunctionTypes.cpp b/test/unit-tests/printing/parser/FunctionTypes.cpp index 2c5bd2ef0..1449afbd9 100644 --- a/test/unit-tests/printing/parser/FunctionTypes.cpp +++ b/test/unit-tests/printing/parser/FunctionTypes.cpp @@ -9,7 +9,7 @@ using mimicpp::printing::type::parse_type; namespace lexing = mimicpp::printing::type::lexing; -namespace state = mimicpp::printing::type::parsing::v2::state; +namespace state = mimicpp::printing::type::parsing::state; namespace { diff --git a/test/unit-tests/printing/parser/OperatorFunctions.cpp b/test/unit-tests/printing/parser/OperatorFunctions.cpp index f1f1aeb72..c2a9ea65e 100644 --- a/test/unit-tests/printing/parser/OperatorFunctions.cpp +++ b/test/unit-tests/printing/parser/OperatorFunctions.cpp @@ -9,7 +9,7 @@ using mimicpp::printing::type::parse_type; namespace lexing = mimicpp::printing::type::lexing; -namespace state = mimicpp::printing::type::parsing::v2::state; +namespace state = mimicpp::printing::type::parsing::state; TEST_CASE( "parsing::parse_type supports types with a nested operator scope.", diff --git a/test/unit-tests/printing/parser/PointerDeclarations.cpp b/test/unit-tests/printing/parser/PointerDeclarations.cpp index 54abab1c6..332fec597 100644 --- a/test/unit-tests/printing/parser/PointerDeclarations.cpp +++ b/test/unit-tests/printing/parser/PointerDeclarations.cpp @@ -9,7 +9,7 @@ using mimicpp::printing::type::parse_type; namespace lexing = mimicpp::printing::type::lexing; -namespace state = mimicpp::printing::type::parsing::v2::state; +namespace state = mimicpp::printing::type::parsing::state; namespace { diff --git a/test/unit-tests/printing/parser/QualifiedTypes.cpp b/test/unit-tests/printing/parser/QualifiedTypes.cpp index 50dd3e8a1..c290a8d3b 100644 --- a/test/unit-tests/printing/parser/QualifiedTypes.cpp +++ b/test/unit-tests/printing/parser/QualifiedTypes.cpp @@ -9,7 +9,7 @@ using mimicpp::printing::type::parse_type; namespace lexing = mimicpp::printing::type::lexing; -namespace state = mimicpp::printing::type::parsing::v2::state; +namespace state = mimicpp::printing::type::parsing::state; namespace { diff --git a/test/unit-tests/printing/parser/Unparsable.cpp b/test/unit-tests/printing/parser/Unparsable.cpp index a1f1efd49..779103bd3 100644 --- a/test/unit-tests/printing/parser/Unparsable.cpp +++ b/test/unit-tests/printing/parser/Unparsable.cpp @@ -18,6 +18,7 @@ TEST_CASE( "int* int", "int", "int[int]"); + CAPTURE(input); CHECK_FALSE(printing::type::parse_type(input)); } From 1dfcfb3f7cf498d1d83e6907dc08b36b5b4bc608 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Fri, 22 May 2026 22:17:01 +0200 Subject: [PATCH 03/10] chore: mark source-location specific test-case as shouldfail on clang-22 --- test/type-name-print-tests/FunctionIdentifiers.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/type-name-print-tests/FunctionIdentifiers.cpp b/test/type-name-print-tests/FunctionIdentifiers.cpp index ce75b2642..8b306f0e5 100644 --- a/test/type-name-print-tests/FunctionIdentifiers.cpp +++ b/test/type-name-print-tests/FunctionIdentifiers.cpp @@ -100,11 +100,16 @@ namespace }; } +#if !MIMICPP_DETAIL_HAS_SOURCE_LOCATION // The `__builtin_FUNCTION` function generates more unreliable names. -#ifdef MIMICPP_DETAIL_HAS_SOURCE_LOCATION - #define PRETTIFY_FUNCTION_SOURCE_LOCATION_FUNCTION_SHOULDFAIL -#else #define PRETTIFY_FUNCTION_SOURCE_LOCATION_FUNCTION_SHOULDFAIL "[!shouldfail]" +#elif MIMICPP_DETAIL_IS_CLANG \ + && __clang_major__ == 22 + // clang-22 changed the lambda synthetic-identifiers + // see https://github.com/llvm/llvm-project/issues/199259 + #define PRETTIFY_FUNCTION_SOURCE_LOCATION_FUNCTION_SHOULDFAIL "[!shouldfail]" +#else + #define PRETTIFY_FUNCTION_SOURCE_LOCATION_FUNCTION_SHOULDFAIL #endif TEST_CASE( From d6b254ac8f0cf0f3933418fb46c4fb26d8a395ff Mon Sep 17 00:00:00 2001 From: DNKpp Date: Fri, 22 May 2026 22:23:56 +0200 Subject: [PATCH 04/10] deps: upgrade cpm to version 0.42.3 --- cmake/get_cpm.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/get_cpm.cmake b/cmake/get_cpm.cmake index fb462d359..2161d1a75 100644 --- a/cmake/get_cpm.cmake +++ b/cmake/get_cpm.cmake @@ -2,8 +2,8 @@ # # SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors -set(CPM_DOWNLOAD_VERSION 0.42.0) -set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a") +set(CPM_DOWNLOAD_VERSION 0.42.3) +set(CPM_HASH_SUM "a609e875fd532b067174250f6abbc3dac22fe2d64869783fb1e80bda1625c844") if(CPM_SOURCE_CACHE) set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") From 127ed1cfd396fdb86e3f8c38b3306a84719ad828 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Sat, 23 May 2026 01:29:00 +0200 Subject: [PATCH 05/10] docs: add clang-22 and gcc-15 to the list of supported compilers --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dda561b67..10d38a6da 100644 --- a/README.md +++ b/README.md @@ -629,6 +629,7 @@ version. | clang-19 | x | x | x | x | x | x | std/fmt | std*/cpptrace/boost | | clang-20 | x | x | x | x | x | x | std/fmt | std*/cpptrace/boost | | clang-21 | x | x | x | x | x | x | std/fmt | std*/cpptrace/boost | +| clang-22 | x | x | x | x | x | x | std/fmt | std*/cpptrace/boost | | gcc-10 | * | * | * | ? | * | * | fmt | cpptrace/boost | | gcc-10.2 | * | * | * | ? | * | * | fmt | cpptrace/boost | | gcc-11 | x | x | x | ? | x | x | fmt | cpptrace/boost | @@ -636,6 +637,7 @@ version. | gcc-13 | x | x | x | ? | x | x | std/fmt | std*/cpptrace/boost | | gcc-14 | x | x | x | ? | x | x | std/fmt | std*/cpptrace/boost | | gcc-15 | x | x | x | ? | x | x | std/fmt | std*/cpptrace/boost | +| gcc-16 | x | x | x | ? | x | x | std/fmt | std*/cpptrace/boost | Note: From bdc1adaa9abfc0838144906b3d7e2fcad506f79e Mon Sep 17 00:00:00 2001 From: DNKpp Date: Sat, 23 May 2026 01:29:21 +0200 Subject: [PATCH 06/10] chore: adjust warning flags for clang and gcc --- README.md | 3 ++- test/cmake/Mimic++-EnableWarnings.cmake | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 10d38a6da..986dee0c2 100644 --- a/README.md +++ b/README.md @@ -576,7 +576,8 @@ The results of these test cases are consistently tracked by an extensive CI syst test case outcomes, and coverage across dozens of different operating systems, compilers, and build configurations. -For the test builds, the flags `-Wall -Wextra -Wpedantic -Werror` (or `/W4 /WX /permissive-` on MSVC) are set. +For the test builds, the flags `-Wall -Wextra -Werror -pedantic -pedantic-errors` +(or `/W4 /WX /permissive-` on MSVC) are set. This ensures that `mimic++` won't flood your build output with endless warnings - or, even worse, break your builds — if you enable these flags in your own projects. diff --git a/test/cmake/Mimic++-EnableWarnings.cmake b/test/cmake/Mimic++-EnableWarnings.cmake index 5a5b4445c..c6cef8a1a 100644 --- a/test/cmake/Mimic++-EnableWarnings.cmake +++ b/test/cmake/Mimic++-EnableWarnings.cmake @@ -1,4 +1,4 @@ -# Copyright Dominic (DNKpp) Koepke 2024 - 2025. +# Copyright Dominic (DNKpp) Koepke 2024-2026. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # https://www.boost.org/LICENSE_1_0.txt) @@ -13,21 +13,20 @@ if (NOT TARGET enable-warnings) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") - set(WARNING_FLAGS /W4 -Wextra -Wpedantic -Werror -Wno-unknown-attributes) + set(WARNING_FLAGS /W4 -Wextra -Werror -Wpedantic -Wno-unknown-attributes) else () # @formatter:off string(CONCAT WARNING_FLAGS "$," "/W4;/WX;/permissive-," - "-Wall;-Wextra;-Wpedantic;-Werror" + "-Wall;-Wextra;-Werror;-pedantic;-pedantic-errors" ">" ) # @formatter:on endif () target_compile_options(enable-warnings INTERFACE - ${WARNING_FLAGS} ) From 1632000d424420bb20931a095cae8081df006f34 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Sat, 23 May 2026 01:34:27 +0200 Subject: [PATCH 07/10] deps: upgrade internally used doctest version to 2.5.2 --- README.md | 2 +- test/adapter-tests/doctest/CMakeLists.txt | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 986dee0c2..af3507977 100644 --- a/README.md +++ b/README.md @@ -549,7 +549,7 @@ The following official adapters exist and can be included from the `mimic++_ext/ * [Boost.Test](https://github.com/boostorg/test) (tested with v1.89.0) * [Catch2](https://github.com/catchorg) (tested with v3.10.0) -* [Doctest](https://github.com/doctest/doctest) (tested with v2.4.12) +* [Doctest](https://github.com/doctest/doctest) (tested with v2.5.2) * [GTest](https://github.com/google/googletest) (tested with v1.15.2) diff --git a/test/adapter-tests/doctest/CMakeLists.txt b/test/adapter-tests/doctest/CMakeLists.txt index 5955ed70c..12548755e 100644 --- a/test/adapter-tests/doctest/CMakeLists.txt +++ b/test/adapter-tests/doctest/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright Dominic (DNKpp) Koepke 2024 - 2025. +# Copyright Dominic (DNKpp) Koepke 2024-2026. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # https://www.boost.org/LICENSE_1_0.txt) @@ -11,17 +11,13 @@ add_executable(${TARGET_NAME} include(Mimic++-EnableSanitizers) enable_sanitizers(${TARGET_NAME}) -CPMAddPackage("gh:doctest/doctest@2.4.12") +CPMAddPackage("gh:doctest/doctest@2.5.2") target_link_libraries(${TARGET_NAME} PRIVATE mimicpp::header-only mimicpp::test::basics doctest::doctest ) -target_compile_options(${TARGET_NAME} PRIVATE - "$<$:-Wno-#warnings>" -) - target_precompile_headers(${TARGET_NAME} PRIVATE ) From c5a8b59ffb0dca3d7c9544572f00d40a95d7f8f0 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Sat, 23 May 2026 01:35:35 +0200 Subject: [PATCH 08/10] deps: upgrade catch2 version to 3.15.0 --- README.md | 2 +- test/cmake/FindCatch2.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af3507977..bb96dc138 100644 --- a/README.md +++ b/README.md @@ -548,7 +548,7 @@ For more details, please refer to the reporting section in the documentation. The following official adapters exist and can be included from the `mimic++_ext/adapters` include directory: * [Boost.Test](https://github.com/boostorg/test) (tested with v1.89.0) -* [Catch2](https://github.com/catchorg) (tested with v3.10.0) +* [Catch2](https://github.com/catchorg) (tested with v3.15.0) * [Doctest](https://github.com/doctest/doctest) (tested with v2.5.2) * [GTest](https://github.com/google/googletest) (tested with v1.15.2) diff --git a/test/cmake/FindCatch2.cmake b/test/cmake/FindCatch2.cmake index a1216c040..9617f8b27 100644 --- a/test/cmake/FindCatch2.cmake +++ b/test/cmake/FindCatch2.cmake @@ -8,7 +8,7 @@ include(get_cpm) # fixes reporting in clion set(CATCH_CONFIG_CONSOLE_WIDTH 800 CACHE STRING "") -CPMAddPackage("gh:catchorg/Catch2@3.14.0") +CPMAddPackage("gh:catchorg/Catch2@3.15.0") if (Catch2_ADDED) include("${Catch2_SOURCE_DIR}/extras/Catch.cmake") From 4fc82c2a69cf29460f30c8a4add7ff6d48d190e2 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Sat, 23 May 2026 02:26:32 +0200 Subject: [PATCH 09/10] fix: fallback to __LINE__ when clang-22 is used --- include/mimic++/macros/Common.hpp | 32 +++++++++++++++++++- include/mimic++/macros/ScopedExpectation.hpp | 8 ++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/include/mimic++/macros/Common.hpp b/include/mimic++/macros/Common.hpp index c443e5de9..1c16cbc46 100644 --- a/include/mimic++/macros/Common.hpp +++ b/include/mimic++/macros/Common.hpp @@ -1,4 +1,4 @@ -// Copyright Dominic (DNKpp) Koepke 2024 - 2025. +// Copyright Dominic (DNKpp) Koepke 2024-2026. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) @@ -179,4 +179,34 @@ namespace mimicpp */ #define MIMICPP_DETAIL_STRINGIFY(...) MIMICPP_DETAIL_STRINGIFY_IMPL(__VA_ARGS__) +/** + * \brief General-purpose counter + * \ingroup MACRO_DETAIL + * \details + * This macro generates unique integer values within the current translation unit. + * Although this mechanism is widely supported, it is not yet part of the official standard. + * However, a proposal to standardize it has already been accepted, so it is expected to become part of future C and C++ standards. + * \see https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3457.htm + * + * Recent versions of Clang (e.g., Clang 22) may emit the following warning: + * > error: '__COUNTER__' is a C2y extension [-Werror,-Wc2y-extensions] + * + * Since this macro is currently only used to generate unique names for scoped-expectations, + * falling back to `__LINE__` should generally be safe in such cases. + * + * \note As a last-resort mechanism, users can override this macro by defining it themselves before including this header. + */ +#ifndef MIMICPP_DETAIL_COUNTER + #if (!defined(__clang__) || __clang_major__ < 22) + #if defined(__COUNTER__) \ + && (__COUNTER__ + 1 == __COUNTER__ + 0) + #define MIMICPP_DETAIL_COUNTER __COUNTER__ + #endif + #endif + + #ifndef MIMICPP_DETAIL_COUNTER + #define MIMICPP_DETAIL_COUNTER __LINE__ + #endif +#endif + #endif diff --git a/include/mimic++/macros/ScopedExpectation.hpp b/include/mimic++/macros/ScopedExpectation.hpp index e570d5f42..d74131eb7 100644 --- a/include/mimic++/macros/ScopedExpectation.hpp +++ b/include/mimic++/macros/ScopedExpectation.hpp @@ -1,4 +1,4 @@ -// Copyright Dominic (DNKpp) Koepke 2024 - 2025. +// Copyright Dominic (DNKpp) Koepke 2024-2026. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) @@ -6,6 +6,8 @@ #ifndef MIMICPP_MACROS_SCOPED_EXPECTATION_HPP #define MIMICPP_MACROS_SCOPED_EXPECTATION_HPP +#include "mimic++/macros/Common.hpp" + #define MIMICPP_DETAIL_UNIQUE_NAME(prefix, counter) prefix##counter #define MIMICPP_DETAIL_SCOPED_EXPECTATION_IMPL(counter) \ [[maybe_unused]] \ @@ -15,16 +17,14 @@ * \brief Convenience macro, which creates a ScopedExpectation with a unique name. * \ingroup MOCK */ -#define MIMICPP_SCOPED_EXPECTATION MIMICPP_DETAIL_SCOPED_EXPECTATION_IMPL(__COUNTER__) +#define MIMICPP_SCOPED_EXPECTATION MIMICPP_DETAIL_SCOPED_EXPECTATION_IMPL(MIMICPP_DETAIL_COUNTER) #ifndef MIMICPP_CONFIG_ONLY_PREFIXED_MACROS - /** * \brief Shorthand variant of \ref MIMICPP_SCOPED_EXPECTATION. * \ingroup MOCK */ #define SCOPED_EXP MIMICPP_SCOPED_EXPECTATION - #endif #endif From 0a5787f8a4e0b55e955c41ef3e53d1d5c09d2177 Mon Sep 17 00:00:00 2001 From: DNKpp Date: Sat, 23 May 2026 02:32:59 +0200 Subject: [PATCH 10/10] fix: disable c2y-extensions for clang-22 in boost-adapter-test --- test/adapter-tests/boost-test/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/adapter-tests/boost-test/CMakeLists.txt b/test/adapter-tests/boost-test/CMakeLists.txt index f46816fb0..196d30a16 100644 --- a/test/adapter-tests/boost-test/CMakeLists.txt +++ b/test/adapter-tests/boost-test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright Dominic (DNKpp) Koepke 2024 - 2025. +# Copyright Dominic (DNKpp) Koepke 2024-2026. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # https://www.boost.org/LICENSE_1_0.txt) @@ -18,6 +18,20 @@ target_link_libraries(${TARGET_NAME} PRIVATE Boost::unit_test_framework ) +# @formatter:off +string(CONCAT DISABLE_C2Y_EXTENSION_WARNING + "$<" + "$," + "$,22>>" + ":-Wno-c2y-extensions>" +) +# @formatter:on + +target_compile_options(${TARGET_NAME} PRIVATE + ${DISABLE_C2Y_EXTENSION_WARNING} +) + target_precompile_headers(${TARGET_NAME} PRIVATE )