Add PCH support and 'CATCH_ENABLE_PCH' flag

This commit is contained in:
vittorioromeo
2024-02-07 19:29:21 +01:00
parent 1078e7e95b
commit 38710a38b1
12 changed files with 135 additions and 70 deletions

View File

@@ -25,6 +25,16 @@ namespace bar {
struct TypeList {};
}
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
#ifdef __GNUC__
// Note that because -~GCC~-, this warning cannot be silenced temporarily, by pushing diagnostic stack...
// Luckily it is firing in test files and thus can be silenced for the whole file, without losing much.
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-declarations"
#endif
@@ -77,16 +87,6 @@ struct B : private A {
bool operator==(int) const { return true; }
};
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
#ifdef __GNUC__
// Note that because -~GCC~-, this warning cannot be silenced temporarily, by pushing diagnostic stack...
// Luckily it is firing in test files and thus can be silenced for the whole file, without losing much.
#pragma GCC diagnostic ignored "-Wunused-function"
#endif
B f();
std::ostream g();

View File

@@ -11,6 +11,8 @@
#if defined(CATCH_CONFIG_CPP17_OPTIONAL)
#include <optional>
TEST_CASE( "std::optional<int> -> toString", "[toString][optional][approvals]" ) {
using type = std::optional<int>;
REQUIRE( "{ }" == ::Catch::Detail::stringify( type{} ) );