diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2232df063c..84f6e4bf2f 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"
diff --git a/README.md b/README.md
index dda561b678..bb96dc1384 100644
--- a/README.md
+++ b/README.md
@@ -548,8 +548,8 @@ 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)
-* [Doctest](https://github.com/doctest/doctest) (tested with v2.4.12)
+* [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)
@@ -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.
@@ -629,6 +630,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 +638,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:
diff --git a/cmake/get_cpm.cmake b/cmake/get_cpm.cmake
index fb462d3597..2161d1a75b 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")
diff --git a/include/mimic++/macros/Common.hpp b/include/mimic++/macros/Common.hpp
index c443e5de9c..1c16cbc465 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 e570d5f428..d74131eb7f 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
diff --git a/include/mimic++/printing/type/Parser.hpp b/include/mimic++/printing/type/Parser.hpp
index 1217ca0106..f6ab585a61 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 078b9e7145..4efa144baf 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 0bdc911802..b8f8a1f1fe 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 03905f9fe4..91d254d2e6 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/adapter-tests/boost-test/CMakeLists.txt b/test/adapter-tests/boost-test/CMakeLists.txt
index f46816fb0b..196d30a161 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
)
diff --git a/test/adapter-tests/doctest/CMakeLists.txt b/test/adapter-tests/doctest/CMakeLists.txt
index 5955ed70c0..12548755e5 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
)
diff --git a/test/cmake/FindCatch2.cmake b/test/cmake/FindCatch2.cmake
index a1216c0409..9617f8b278 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")
diff --git a/test/cmake/Mimic++-EnableWarnings.cmake b/test/cmake/Mimic++-EnableWarnings.cmake
index 5a5b4445c5..c6cef8a1a0 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}
)
diff --git a/test/type-name-print-tests/FunctionIdentifiers.cpp b/test/type-name-print-tests/FunctionIdentifiers.cpp
index ce75b2642d..8b306f0e57 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(
diff --git a/test/unit-tests/printing/parser/BuiltinTypes.cpp b/test/unit-tests/printing/parser/BuiltinTypes.cpp
index 7352ab2be9..dd0eb85b22 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 1c7a1711e6..c8474456a0 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 2c5bd2ef05..1449afbd96 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 f1f1aeb725..c2a9ea65ec 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 54abab1c6f..332fec5979 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 50dd3e8a1a..c290a8d3b0 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 a1f1efd494..779103bd32 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));
}