Skip to content

Commit 35bdc46

Browse files
committed
Fix compilation on clang 19+
1 parent 6f76c6c commit 35bdc46

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ cmake_policy(SET CMP0135 NEW)
99
include(FetchContent)
1010

1111
FetchContent_Declare(argparse
12-
URL https://github.com/p-ranav/argparse/archive/refs/tags/v3.0.tar.gz
12+
GIT_REPOSITORY https://github.com/p-ranav/argparse/
13+
GIT_TAG v3.1
14+
GIT_SHALLOW 1
1315
)
1416
FetchContent_MakeAvailable(argparse)
1517

1618
FetchContent_Declare(cxx-prettyprint
17-
URL https://github.com/louisdx/cxx-prettyprint/archive/refs/heads/master.tar.gz
19+
GIT_REPOSITORY https://github.com/louisdx/cxx-prettyprint/
20+
GIT_TAG master
21+
GIT_SHALLOW 1
1822
)
1923
FetchContent_MakeAvailable(cxx-prettyprint)
2024

@@ -31,6 +35,7 @@ target_link_libraries(c++spec INTERFACE
3135
cxx-prettyprint
3236
argparse
3337
)
38+
target_compile_options(c++spec INTERFACE -Wno-missing-template-arg-list-after-template-kw)
3439

3540
FILE(GLOB_RECURSE c++spec_headers ${CMAKE_CURRENT_LIST_DIR}/include/*.hpp)
3641

include/child.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
#pragma once
1111

12-
#ifndef CPPSPEC_DEBUG
13-
#define CPPSPEC_DEBUG false
14-
#endif
15-
1612
#include <iostream>
1713
#include <memory>
1814
#include <string>

include/matchers/errors/have_error.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ class HaveError : public MatcherBase<T, void *> {
1616
public:
1717
HaveError(Expectation<T> &expectation) : MatcherBase<T, void *>(expectation) {}
1818

19-
bool match() { return (!this->actual().has_value()); }
19+
std::string description() override {return "have an error"; }
20+
21+
bool match() override { return (!this->actual().has_value()); }
2022
};
2123

2224
template <expected T, typename E>

include/matchers/errors/have_value.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@ class HaveValue : public MatcherBase<T, void *> {
1515
public:
1616
HaveValue(Expectation<T> &expectation) : MatcherBase<T, void *>(expectation) {}
1717

18-
bool match() { return (this->actual().has_value()); }
18+
std::string description() override {return "have a value"; }
19+
20+
bool match() override { return (this->actual().has_value()); }
1921
};
2022

2123
template <optional T, typename E>
22-
class HaveValueEqualTo : public MatcherBase<T, E> {
24+
class HaveValueEqualTo : public Equal<T, E> {
2325
public:
2426
static_assert(std::is_same_v<typename T::value_type, E>,
2527
"the contained value_type must match the expected type");
26-
HaveValueEqualTo(Expectation<T> &expectation, E expected) : MatcherBase<T, E>(expectation, expected) {}
28+
HaveValueEqualTo(Expectation<T> &expectation, E expected) : Equal<T, E>(expectation, expected) {}
2729

2830
bool match() { return (this->actual().value() == this->expected()); }
2931
};

0 commit comments

Comments
 (0)