mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-19 19:25:38 +02:00
Sweep out some extra warnings
Swept: `-Wpadded` in some places (where it caused extra size, instead of just saying "hey, we padded struct at the end to align, just as standard says") `-Wweak-vtables` everywhere (Clang) `-Wexit-time-destructors` everywhere (Clang) `-Wmissing-noreturn` everywhere (Clang) The last three are enabled for Clang compilation going forward. Also enabled `-Wunreachable-code` for Clang and GCC
This commit is contained in:
@@ -8,6 +8,12 @@
|
||||
|
||||
#include "catch.hpp"
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wweak-vtables"
|
||||
#pragma clang diagnostic ignored "-Wpadded"
|
||||
#endif
|
||||
|
||||
#ifndef CATCH_CONFIG_DISABLE_MATCHERS
|
||||
|
||||
inline const char* testStringForMatching()
|
||||
@@ -166,16 +172,18 @@ TEST_CASE( "Vector matchers that fail", "[matchers][vector][.][failing]" ) {
|
||||
#include <exception>
|
||||
|
||||
struct SpecialException : std::exception {
|
||||
SpecialException(int i):i(i) {}
|
||||
SpecialException(int i_):i(i_) {}
|
||||
int i;
|
||||
};
|
||||
|
||||
void doesNotThrow() {}
|
||||
|
||||
[[noreturn]]
|
||||
void throws(int i) {
|
||||
throw SpecialException{ i };
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
void throwsAsInt(int i) {
|
||||
throw i;
|
||||
}
|
||||
@@ -217,3 +225,7 @@ TEST_CASE("Exception matchers that fail", "[matchers][exceptions][!throws][.fail
|
||||
}
|
||||
|
||||
#endif // CATCH_CONFIG_DISABLE_MATCHERS
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user