Ticket #8381: spirit_static_assert.patch
File spirit_static_assert.patch, 12.3 KB (added by , 10 years ago) |
---|
-
boost/spirit/home/karma/char/char.hpp
137 137 // providing any attribute, as the generator doesn't 'know' what 138 138 // character to output. The following assertion fires if this 139 139 // situation is detected in your code. 140 BOOST_SPIRIT_ASSERT_ MSG(false, char_not_usable_without_attribute, ());140 BOOST_SPIRIT_ASSERT_FAIL(CharParam, char_not_usable_without_attribute, ()); 141 141 return false; 142 142 } 143 143 … … 230 230 template <typename CharParam, typename Context> 231 231 bool test(unused_type, CharParam&, Context&) const 232 232 { 233 // It is not possible (doesn't make sense) to use char_ generators 234 // without providing any attribute, as the generator doesn't 'know' 233 // It is not possible (doesn't make sense) to use char_ generators 234 // without providing any attribute, as the generator doesn't 'know' 235 235 // what to output. The following assertion fires if this situation 236 236 // is detected in your code. 237 BOOST_SPIRIT_ASSERT_ MSG(false237 BOOST_SPIRIT_ASSERT_FAIL(CharParam 238 238 , char_range_not_usable_without_attribute, ()); 239 239 return false; 240 240 } … … 316 316 template <typename CharParam, typename Context> 317 317 bool test(unused_type, CharParam&, Context&) const 318 318 { 319 // It is not possible (doesn't make sense) to use char_ generators 320 // without providing any attribute, as the generator doesn't 'know' 319 // It is not possible (doesn't make sense) to use char_ generators 320 // without providing any attribute, as the generator doesn't 'know' 321 321 // what to output. The following assertion fires if this situation 322 322 // is detected in your code. 323 BOOST_SPIRIT_ASSERT_ MSG(false323 BOOST_SPIRIT_ASSERT_FAIL(CharParam 324 324 , char_set_not_usable_without_attribute, ()); 325 325 return false; 326 326 } -
boost/spirit/home/karma/char/char_class.hpp
95 95 template <typename CharParam, typename Context> 96 96 bool test(unused_type, CharParam&, Context&) const 97 97 { 98 // It is not possible (doesn't make sense) to use char_ generators 99 // without providing any attribute, as the generator doesn't 'know' 98 // It is not possible (doesn't make sense) to use char_ generators 99 // without providing any attribute, as the generator doesn't 'know' 100 100 // what to output. The following assertion fires if this situation 101 101 // is detected in your code. 102 BOOST_SPIRIT_ASSERT_ MSG(false102 BOOST_SPIRIT_ASSERT_FAIL(CharParam 103 103 , char_class_not_usable_without_attribute, ()); 104 104 return false; 105 105 } -
boost/spirit/home/karma/numeric/real.hpp
203 203 // without providing any attribute, as the generator doesn't 'know' 204 204 // what to output. The following assertion fires if this situation 205 205 // is detected in your code. 206 BOOST_SPIRIT_ASSERT_MSG(false, real_not_usable_without_attribute, ()); return false; 206 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, real_not_usable_without_attribute, ()); 207 return false; 207 208 } 208 209 209 210 template <typename Context> -
boost/spirit/home/karma/numeric/int.hpp
252 252 // without providing any attribute, as the generator doesn't 'know' 253 253 // what to output. The following assertion fires if this situation 254 254 // is detected in your code. 255 BOOST_SPIRIT_ASSERT_ MSG(false, int_not_usable_without_attribute, ());255 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, int_not_usable_without_attribute, ()); 256 256 return false; 257 257 } 258 258 -
boost/spirit/home/karma/numeric/bool.hpp
171 171 // without providing any attribute, as the generator doesn't 'know' 172 172 // what to output. The following assertion fires if this situation 173 173 // is detected in your code. 174 BOOST_SPIRIT_ASSERT_ MSG(false, bool_not_usable_without_attribute, ());174 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, bool_not_usable_without_attribute, ()); 175 175 return false; 176 176 } 177 177 -
boost/spirit/home/karma/numeric/uint.hpp
287 287 // without providing any attribute, as the generator doesn't 'know' 288 288 // what to output. The following assertion fires if this situation 289 289 // is detected in your code. 290 BOOST_SPIRIT_ASSERT_ MSG(false, uint_not_usable_without_attribute, ());290 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, uint_not_usable_without_attribute, ()); 291 291 return false; 292 292 } 293 293 -
boost/spirit/home/karma/string/lit.hpp
127 127 // providing any attribute, as the generator doesn't 'know' what 128 128 // character to output. The following assertion fires if this 129 129 // situation is detected in your code. 130 BOOST_SPIRIT_ASSERT_ MSG(false, string_not_usable_without_attribute, ());130 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, string_not_usable_without_attribute, ()); 131 131 return false; 132 132 } 133 133 -
boost/spirit/home/karma/binary/binary.hpp
280 280 // without providing any attribute, as the generator doesn't 'know' 281 281 // what to output. The following assertion fires if this situation 282 282 // is detected in your code. 283 BOOST_SPIRIT_ASSERT_ MSG(false,283 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, 284 284 binary_generator_not_usable_without_attribute, ()); 285 285 return false; 286 286 } -
boost/spirit/home/karma/stream/stream.hpp
192 192 static bool 193 193 generate(OutputIterator&, Context&, Delimiter const&, unused_type) 194 194 { 195 // It is not possible (doesn't make sense) to use stream generators 196 // without providing any attribute, as the generator doesn't 'know' 195 // It is not possible (doesn't make sense) to use stream generators 196 // without providing any attribute, as the generator doesn't 'know' 197 197 // what to output. The following assertion fires if this situation 198 198 // is detected in your code. 199 BOOST_SPIRIT_ASSERT_ MSG(false, stream_not_usable_without_attribute, ());199 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, stream_not_usable_without_attribute, ()); 200 200 return false; 201 201 } 202 202 -
boost/spirit/home/karma/auto/auto.hpp
90 90 // without providing any attribute, as the generator doesn't 'know' 91 91 // what to output. The following assertion fires if this situation 92 92 // is detected in your code. 93 BOOST_SPIRIT_ASSERT_ MSG(false, auto_not_usable_without_attribute, ());93 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator, auto_not_usable_without_attribute, ()); 94 94 return false; 95 95 } 96 96 -
boost/spirit/home/support/assert_msg.hpp
33 33 34 34 #define BOOST_SPIRIT_ASSERT_MATCH(Domain, Expr) \ 35 35 BOOST_SPIRIT_ASSERT_MSG(( \ 36 boost::spirit::traits::matches< Domain, Expr>::value\36 boost::spirit::traits::matches< Domain, Expr >::value \ 37 37 ), error_invalid_expression, (Expr)) 38 38 39 // GCC 4.7 will overeagerly instantiate static_asserts in template functions, if the assert condition 40 // does not depend on template parameters (see https://svn.boost.org/trac/boost/ticket/8381). 41 // There are places where we want to use constant false as the condition in template functions 42 // to indicate that these function overloads should never be called. This allows to generate 43 // better error messages. To solve this problem we make the condition dependent on the template argument 44 // and use the following macro in such places. 45 #include <boost/type_traits/is_same.hpp> 46 47 #define BOOST_SPIRIT_ASSERT_FAIL(TemplateParam, Msg, Types) \ 48 BOOST_SPIRIT_ASSERT_MSG((!boost::is_same< TemplateParam, TemplateParam >::value), Msg, Types) 49 39 50 #endif 40 51 -
boost/spirit/repository/home/qi/nonterminal/subrule.hpp
529 529 { 530 530 // If you are seeing a compilation error here, you are trying 531 531 // to use a subrule as a parser outside of a subrule group. 532 BOOST_SPIRIT_ASSERT_ MSG(false532 BOOST_SPIRIT_ASSERT_FAIL(Iterator 533 533 , subrule_used_outside_subrule_group, (id_type)); 534 534 535 535 return false; … … 558 558 { 559 559 // If you are seeing a compilation error here, you are trying 560 560 // to use a subrule as a parser outside of a subrule group. 561 BOOST_SPIRIT_ASSERT_ MSG(false561 BOOST_SPIRIT_ASSERT_FAIL(Iterator 562 562 , subrule_used_outside_subrule_group, (id_type)); 563 563 564 564 return false; -
boost/spirit/repository/home/karma/nonterminal/subrule.hpp
503 503 { 504 504 // If you are seeing a compilation error here, you are trying 505 505 // to use a subrule as a generator outside of a subrule group. 506 BOOST_SPIRIT_ASSERT_ MSG(false506 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator 507 507 , subrule_used_outside_subrule_group, (id_type)); 508 508 509 509 return false; … … 532 532 { 533 533 // If you are seeing a compilation error here, you are trying 534 534 // to use a subrule as a generator outside of a subrule group. 535 BOOST_SPIRIT_ASSERT_ MSG(false535 BOOST_SPIRIT_ASSERT_FAIL(OutputIterator 536 536 , subrule_used_outside_subrule_group, (id_type)); 537 537 538 538 return false;