Skip to content

Commit be0bf71

Browse files
committed
doctest: Patch for clang warning about replacing <ciso646> by <version>
1 parent ce94b26 commit be0bf71

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

thirdparty/doctest/doctest.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,20 @@ DOCTEST_GCC_SUPPRESS_WARNING_POP
490490
#endif
491491
#endif // DOCTEST_CONFIG_USE_IOSFWD
492492

493-
// for clang - always include ciso646 (which drags some std stuff) because
494-
// we want to check if we are using libc++ with the _LIBCPP_VERSION macro in
493+
// BEGIN TEMPORARY PATCH (comes from https://github.com/doctest/doctest/pull/901)
494+
// for clang - always include <version> or <ciso646> (which drags some std stuff)
495+
// because we want to check if we are using libc++ with the _LIBCPP_VERSION macro in
495496
// which case we don't want to forward declare stuff from std - for reference:
496497
// https://github.com/doctest/doctest/issues/126
497498
// https://github.com/doctest/doctest/issues/356
498499
#if DOCTEST_CLANG
500+
#if DOCTEST_CPLUSPLUS >= 201703L && __has_include(<version>)
501+
#include <version>
502+
#else
499503
#include <ciso646>
504+
#endif
500505
#endif // clang
506+
// END TEMPORARY PATCH
501507

502508
#ifdef _LIBCPP_VERSION
503509
#ifndef DOCTEST_CONFIG_USE_STD_HEADERS
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/thirdparty/doctest/doctest.h b/thirdparty/doctest/doctest.h
2+
index 5c754cde08a..482749ccb2b 100644
3+
--- a/thirdparty/doctest/doctest.h
4+
+++ b/thirdparty/doctest/doctest.h
5+
@@ -490,14 +490,20 @@ DOCTEST_GCC_SUPPRESS_WARNING_POP
6+
#endif
7+
#endif // DOCTEST_CONFIG_USE_IOSFWD
8+
9+
-// for clang - always include ciso646 (which drags some std stuff) because
10+
-// we want to check if we are using libc++ with the _LIBCPP_VERSION macro in
11+
+// BEGIN TEMPORARY PATCH (comes from https://github.com/doctest/doctest/pull/901)
12+
+// for clang - always include <version> or <ciso646> (which drags some std stuff)
13+
+// because we want to check if we are using libc++ with the _LIBCPP_VERSION macro in
14+
// which case we don't want to forward declare stuff from std - for reference:
15+
// https://github.com/doctest/doctest/issues/126
16+
// https://github.com/doctest/doctest/issues/356
17+
#if DOCTEST_CLANG
18+
+#if DOCTEST_CPLUSPLUS >= 201703L && __has_include(<version>)
19+
+#include <version>
20+
+#else
21+
#include <ciso646>
22+
+#endif
23+
#endif // clang
24+
+// END TEMPORARY PATCH
25+
26+
#ifdef _LIBCPP_VERSION
27+
#ifndef DOCTEST_CONFIG_USE_STD_HEADERS

0 commit comments

Comments
 (0)