|
95 | 95 | // Suppress shadow and unused-value warning for sections: |
96 | 96 |
|
97 | 97 | #if defined (__clang__) |
| 98 | +# define lest_SUPPRESS_WMISBRACES _Pragma( "clang diagnostic push" ) \ |
| 99 | + _Pragma( "clang diagnostic ignored \"-Wmissing-braces\"" ) |
98 | 100 | # define lest_SUPPRESS_WSHADOW _Pragma( "clang diagnostic push" ) \ |
99 | 101 | _Pragma( "clang diagnostic ignored \"-Wshadow\"" ) |
100 | 102 | # define lest_SUPPRESS_WUNUSED _Pragma( "clang diagnostic push" ) \ |
101 | 103 | _Pragma( "clang diagnostic ignored \"-Wunused-value\"" ) |
102 | 104 | # define lest_RESTORE_WARNINGS _Pragma( "clang diagnostic pop" ) |
103 | 105 |
|
104 | 106 | #elif defined (__GNUC__) |
| 107 | +# define lest_SUPPRESS_WMISBRACES /*empty*/ |
105 | 108 | # define lest_SUPPRESS_WSHADOW _Pragma( "GCC diagnostic push" ) \ |
106 | 109 | _Pragma( "GCC diagnostic ignored \"-Wshadow\"" ) |
107 | 110 | # define lest_SUPPRESS_WUNUSED _Pragma( "GCC diagnostic push" ) \ |
108 | 111 | _Pragma( "GCC diagnostic ignored \"-Wunused-value\"" ) |
109 | 112 | # define lest_RESTORE_WARNINGS _Pragma( "GCC diagnostic pop" ) |
110 | 113 | #else |
| 114 | +# define lest_SUPPRESS_WMISBRACES /*empty*/ |
111 | 115 | # define lest_SUPPRESS_WSHADOW /*empty*/ |
112 | 116 | # define lest_SUPPRESS_WUNUSED /*empty*/ |
113 | 117 | # define lest_RESTORE_WARNINGS /*empty*/ |
|
192 | 196 | #else // lest_FEATURE_AUTO_REGISTER |
193 | 197 |
|
194 | 198 | # define lest_CASE( proposition ) \ |
195 | | - proposition, []( lest::env & lest_env ) |
| 199 | + lest_SUPPRESS_WMISBRACES \ |
| 200 | + proposition, []( lest::env & lest_env ) \ |
| 201 | + lest_RESTORE_WARNINGS |
196 | 202 |
|
197 | 203 | # define lest_CASE_ON( proposition, ... ) \ |
198 | | - proposition, [__VA_ARGS__]( lest::env & lest_env ) |
| 204 | + lest_SUPPRESS_WMISBRACES \ |
| 205 | + proposition, [__VA_ARGS__]( lest::env & lest_env ) \ |
| 206 | + lest_RESTORE_WARNINGS |
199 | 207 |
|
200 | 208 | # define lest_MODULE( specification, module ) \ |
201 | 209 | namespace { lest::add_module _( specification, module ); } |
|
0 commit comments