mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
push/pop warnings when disabling parentheses warnings within assertion (gcc/ clang)
This commit is contained in:
parent
c9a37c59c4
commit
fe690a68ef
@ -45,6 +45,7 @@
|
|||||||
try { \
|
try { \
|
||||||
CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
||||||
( __catchResult <= expr ).endExpression(); \
|
( __catchResult <= expr ).endExpression(); \
|
||||||
|
CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
|
||||||
} \
|
} \
|
||||||
catch( ... ) { \
|
catch( ... ) { \
|
||||||
__catchResult.useActiveException( resultDisposition ); \
|
__catchResult.useActiveException( resultDisposition ); \
|
||||||
|
@ -62,7 +62,11 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(CATCH_CPP11_OR_GREATER)
|
# if defined(CATCH_CPP11_OR_GREATER)
|
||||||
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
|
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
||||||
|
_Pragma( "clang diagnostic push" ) \
|
||||||
|
_Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
|
||||||
|
# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
|
||||||
|
_Pragma( "clang diagnostic pop" )
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#endif // __clang__
|
#endif // __clang__
|
||||||
@ -97,9 +101,15 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) && defined(CATCH_CPP11_OR_GREATER)
|
# if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) && defined(CATCH_CPP11_OR_GREATER)
|
||||||
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
|
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
|
||||||
|
_Pragma( "GCC diagnostic push" ) \
|
||||||
|
_Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
|
||||||
|
# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS \
|
||||||
|
_Pragma( "GCC diagnostic pop" )
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// - otherwise more recent versions define __cplusplus >= 201103L
|
// - otherwise more recent versions define __cplusplus >= 201103L
|
||||||
// and will get picked up below
|
// and will get picked up below
|
||||||
|
|
||||||
@ -242,6 +252,7 @@
|
|||||||
|
|
||||||
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
|
#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
|
||||||
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
|
# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
|
||||||
|
# define CATCH_INTERNAL_UNSUPPRESS_PARENTHESES_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// noexcept support:
|
// noexcept support:
|
||||||
|
Loading…
Reference in New Issue
Block a user