Skip to content

Commit f602900

Browse files
committed
Fix balance diagnostics push-pop for gcc (PR 19 extra, PR #83)
1 parent fed30e6 commit f602900

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

include/lest/lest.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
#if defined (__clang__)
9898
# define lest_SUPPRESS_WMISBRACES _Pragma( "clang diagnostic push" ) \
9999
_Pragma( "clang diagnostic ignored \"-Wmissing-braces\"" )
100+
# define lest_RESTORE_WMISBRACES _Pragma( "clang diagnostic pop" )
101+
100102
# define lest_SUPPRESS_WSHADOW _Pragma( "clang diagnostic push" ) \
101103
_Pragma( "clang diagnostic ignored \"-Wshadow\"" )
102104
# define lest_SUPPRESS_WUNUSED _Pragma( "clang diagnostic push" ) \
@@ -105,13 +107,16 @@
105107

106108
#elif defined (__GNUC__)
107109
# define lest_SUPPRESS_WMISBRACES /*empty*/
110+
# define lest_RESTORE_WMISBRACES /*empty*/
111+
108112
# define lest_SUPPRESS_WSHADOW _Pragma( "GCC diagnostic push" ) \
109113
_Pragma( "GCC diagnostic ignored \"-Wshadow\"" )
110114
# define lest_SUPPRESS_WUNUSED _Pragma( "GCC diagnostic push" ) \
111115
_Pragma( "GCC diagnostic ignored \"-Wunused-value\"" )
112116
# define lest_RESTORE_WARNINGS _Pragma( "GCC diagnostic pop" )
113117
#else
114118
# define lest_SUPPRESS_WMISBRACES /*empty*/
119+
# define lest_RESTORE_WMISBRACES /*empty*/
115120
# define lest_SUPPRESS_WSHADOW /*empty*/
116121
# define lest_SUPPRESS_WUNUSED /*empty*/
117122
# define lest_RESTORE_WARNINGS /*empty*/
@@ -198,12 +203,12 @@
198203
# define lest_CASE( proposition ) \
199204
lest_SUPPRESS_WMISBRACES \
200205
proposition, []( lest::env & lest_env ) \
201-
lest_RESTORE_WARNINGS
206+
lest_RESTORE_WMISBRACES
202207

203208
# define lest_CASE_ON( proposition, ... ) \
204209
lest_SUPPRESS_WMISBRACES \
205210
proposition, [__VA_ARGS__]( lest::env & lest_env ) \
206-
lest_RESTORE_WARNINGS
211+
lest_RESTORE_WMISBRACES
207212

208213
# define lest_MODULE( specification, module ) \
209214
namespace { lest::add_module _( specification, module ); }

0 commit comments

Comments
 (0)