mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 23:36:11 +01:00
Remove usage of __builtin_constant_p under IBM XL
This commit is contained in:
parent
d399a308d0
commit
035a062596
@ -58,7 +58,20 @@
|
|||||||
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
|
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
|
||||||
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
|
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
|
||||||
|
|
||||||
|
// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
|
||||||
|
// which results in calls to destructors being emitted for each temporary,
|
||||||
|
// without a matching initialization. In practice, this can result in something
|
||||||
|
// like `std::string::~string` being called on an uninitialized value.
|
||||||
|
//
|
||||||
|
// For example, this code will likely segfault under IBM XL:
|
||||||
|
// ```
|
||||||
|
// REQUIRE(std::string("12") + "34" == "1234")
|
||||||
|
// ```
|
||||||
|
//
|
||||||
|
// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
|
||||||
|
# if !defined(__ibmxl__)
|
||||||
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg) */
|
# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg) */
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
|
||||||
|
Loading…
Reference in New Issue
Block a user