Skip to content

Commit 1eaa63c

Browse files
authored
Merge pull request #358 from eranpeer/fix-msvc-apple-clang-errors
Fix some warnings on some compilers.
2 parents bd11787 + adda8b2 commit 1eaa63c

File tree

10 files changed

+67
-6
lines changed

10 files changed

+67
-6
lines changed

.github/workflows/ci_linux_clang.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ jobs:
8181
cc: "clang-18", cxx: "clang++-18",
8282
cxx_standard: 23
8383
}
84+
- {
85+
name: "Ubuntu 24.04 Clang 18 C++26",
86+
os: ubuntu-24.04,
87+
build_type: Debug,
88+
cc: "clang-18", cxx: "clang++-18",
89+
cxx_standard: 26
90+
}
8491
- {
8592
name: "Ubuntu 24.04 Clang with sanitizers",
8693
os: ubuntu-24.04,

.github/workflows/ci_linux_gcc.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ jobs:
7575
cc: "gcc-14", cxx: "g++-14",
7676
cxx_standard: 23
7777
}
78+
- {
79+
name: "Ubuntu 24.04 GCC 14 C++26",
80+
os: ubuntu-24.04,
81+
build_type: Debug,
82+
cc: "gcc-14", cxx: "g++-14",
83+
cxx_standard: 26
84+
}
7885
- {
7986
name: "Ubuntu 24.04 GCC with sanitizers",
8087
os: ubuntu-24.04,

.github/workflows/ci_macos_appleclang.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,53 @@ jobs:
1717
matrix:
1818
config:
1919
- {
20-
name: "macOS 15 AppleClang 15 C++11",
20+
name: "macOS 14 AppleClang 15 C++11",
21+
os: macos-14,
22+
build_type: Debug,
23+
cxx_standard: 11
24+
}
25+
- {
26+
name: "macOS 14 AppleClang 15 C++20",
27+
os: macos-14,
28+
build_type: Debug,
29+
cxx_standard: 20
30+
}
31+
- {
32+
name: "macOS 15 AppleClang 17 C++11",
2133
os: macos-15,
2234
build_type: Debug,
2335
cxx_standard: 11
2436
}
2537
- {
26-
name: "macOS 15 AppleClang 15 C++14",
38+
name: "macOS 15 AppleClang 17 C++14",
2739
os: macos-15,
2840
build_type: Debug,
2941
cxx_standard: 14
3042
}
3143
- {
32-
name: "macOS 15 AppleClang 15 C++17",
44+
name: "macOS 15 AppleClang 17 C++17",
3345
os: macos-15,
3446
build_type: Debug,
3547
cxx_standard: 17
3648
}
3749
- {
38-
name: "macOS 15 AppleClang 15 C++20",
50+
name: "macOS 15 AppleClang 17 C++20",
3951
os: macos-15,
4052
build_type: Debug,
4153
cxx_standard: 20
4254
}
4355
- {
44-
name: "macOS 15 AppleClang 15 C++23",
56+
name: "macOS 15 AppleClang 17 C++23",
4557
os: macos-15,
4658
build_type: Debug,
4759
cxx_standard: 23
4860
}
61+
- {
62+
name: "macOS 15 AppleClang 17 C++26",
63+
os: macos-15,
64+
build_type: Debug,
65+
cxx_standard: 26
66+
}
4967
- {
5068
name: "macOS 15 AppleClang with sanitizers",
5169
os: macos-15,

.github/workflows/ci_windows_msvc.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,22 @@ jobs:
110110
architecture: "x64",
111111
cxx_standard: 23
112112
}
113+
- {
114+
name: "Windows 2025 MSVC 2022 Win32 C++26",
115+
os: windows-2025,
116+
build_type: Debug,
117+
generator: "Visual Studio 17 2022",
118+
architecture: "Win32",
119+
cxx_standard: 26
120+
}
121+
- {
122+
name: "Windows 2025 MSVC 2022 x64 C++26",
123+
os: windows-2025,
124+
build_type: Debug,
125+
generator: "Visual Studio 17 2022",
126+
architecture: "x64",
127+
cxx_standard: 26
128+
}
113129
steps:
114130
- uses: actions/checkout@v3
115131
- name: Build project

include/fakeit/EventFormatter.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace fakeit {
1717

1818
struct EventFormatter {
1919

20+
virtual ~EventFormatter() = default;
21+
2022
virtual std::string format(const fakeit::UnexpectedMethodCallEvent &e) = 0;
2123

2224
virtual std::string format(const fakeit::SequenceVerificationEvent &e) = 0;

include/fakeit/EventHandler.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace fakeit {
1313

1414
struct VerificationEventHandler {
15+
virtual ~VerificationEventHandler() = default;
16+
1517
virtual void handle(const SequenceVerificationEvent &e) = 0;
1618

1719
virtual void handle(const NoMoreInvocationsVerificationEvent &e) = 0;

include/fakeit/SequenceVerificationProgress.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace fakeit {
6262

6363
public:
6464

65-
~SequenceVerificationProgress() FAKEIT_THROWS { };
65+
virtual ~SequenceVerificationProgress() FAKEIT_THROWS = default;
6666

6767
operator bool() const {
6868
return Terminator(_expectationPtr);

include/fakeit/Xaction.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
namespace fakeit {
1212

1313
struct Xaction {
14+
virtual ~Xaction() = default;
15+
1416
virtual void commit() = 0;
1517
};
1618
}

include/mockutils/MethodProxyCreator.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace fakeit {
1111
struct InvocationHandlerCollection {
1212
static const unsigned int VtCookieIndex = 0;
1313

14+
virtual ~InvocationHandlerCollection() = default;
15+
1416
virtual Destructible *getInvocatoinHandlerPtrById(unsigned int index) = 0;
1517

1618
static InvocationHandlerCollection *getInvocationHandlerCollection(void *instance) {

include/mockutils/VTUtils.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ namespace fakeit {
2626
#if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 8
2727
#pragma GCC diagnostic push
2828
#pragma GCC diagnostic ignored "-Wcast-function-type"
29+
#elif defined(__clang__) && ((defined(__apple_build_version__) && __clang_major__ >= 17) || (!defined(__apple_build_version__) && __clang_major__ >= 19))
30+
#pragma clang diagnostic push
31+
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
2932
#endif
3033
template<typename C, typename R, typename ... arglist>
3134
static unsigned int getOffset(R (C::*vMethod)(arglist...)) {
@@ -35,6 +38,8 @@ namespace fakeit {
3538
}
3639
#if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 8
3740
#pragma GCC diagnostic pop
41+
#elif defined(__clang__) && ((defined(__apple_build_version__) && __clang_major__ >= 17) || (!defined(__apple_build_version__) && __clang_major__ >= 19))
42+
#pragma clang diagnostic pop
3843
#endif
3944

4045
template<typename C>

0 commit comments

Comments
 (0)