Commit Graph

4777 Commits

Author SHA1 Message Date
Nikita Kniazev
2641b567de Classic.Tests: tree_to_xml: Fixed bug in container_device::write 2017-11-21 19:49:37 +03:00
Nikita Kniazev
34e078d11e Classic: switch: Fixed right_t typedef shadowing 2017-11-21 19:49:37 +03:00
Nikita Kniazev
9b341b391d Classic.Tests: switch_problem: Fixed unused parameter self warning 2017-11-21 19:49:36 +03:00
Nikita Kniazev
7f012982e2 Classic.Phoenix: composite: Fixed placesholder names shadowing
Could be triggered if one uses `using namespace phoenix`.
2017-11-21 19:49:36 +03:00
Nikita Kniazev
138b055a1d Classic: escape_char: Suppress conditional expression is constant warning
`boost/spirit/home/classic/utility/impl/escape_char.ipp(143): warning C4127: conditional expression is constant`
2017-11-21 19:49:36 +03:00
Nikita Kniazev
27d63eb270 Classic.Tests: ast_calc_tests: Fixed iterator_t shadowing warning 2017-11-21 19:49:36 +03:00
Nikita Kniazev
9bf993abfa Classic: Fixed iter_policy_t and scanner_policies_t shadowing problem
`iter_policy_t` and `scanner_policies_t` declared at Spirit's namespace scope.
2017-11-21 19:49:36 +03:00
Nikita Kniazev
4130a9d041 Classic.Tests: owi_mt_tests: Fixed conversion warning 2017-11-21 19:49:36 +03:00
Nikita Kniazev
8f6a9aaaa3 Classic: file_iterator: Fixed 'size_t' to 'long' conversion warning 2017-11-21 19:49:36 +03:00
Nikita Kniazev
5c44ac5af5 Classic: Fixed unused parameter warnings 2017-11-21 19:49:36 +03:00
Nikita Kniazev
d9564895c6 Fixed unused argc/argv 2017-11-21 19:49:36 +03:00
Nikita Kniazev
6e3c97484d Classic.Tests: escape_char_parser_tests: Fixed unused variable warnings 2017-11-21 19:49:36 +03:00
Nikita Kniazev
625fbc6cd9 Karma.Tests: regression_real_policy_sign: Fixed unused parameter warning 2017-11-21 19:49:35 +03:00
Nikita Kniazev
d06cc5945b Karma.Tests: regression_real_scientific: Fixed semicolon after main function 2017-11-21 19:49:35 +03:00
Nikita Kniazev
4810f02271 Fixed semicolon after BOOST_FUSION_ADAPT_* 2017-11-21 19:49:35 +03:00
Nikita Kniazev
ee900333b4 Lex.Tests: set_token_value: Fixed type conversion warning 2017-11-21 19:49:35 +03:00
Nikita Kniazev
e79f03a062 Qi.Repository: keywords: Fixed unused parameter warnings
```
../boost/spirit/repository/home/qi/directive/kwd.hpp:899:76: warning: unused parameter 'modifiers' [-Wunused-parameter]
../boost/spirit/repository/home/qi/directive/kwd.hpp:922:76: warning: unused parameter 'modifiers' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:510:35: warning: unused parameter 'first' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:511:41: warning: unused parameter 'last' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:512:45: warning: unused parameter 'parse_visitor' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:513:51: warning: unused parameter 'no_case_parse_visitor' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:514:40: warning: unused parameter 'skipper' [-Wunused-parameter]
../boost/spirit/repository/home/qi/operator/detail/keywords.hpp:573:92: warning: unused parameter 'position' [-Wunused-parameter]
```
2017-11-21 19:49:35 +03:00
Nikita Kniazev
0773ca38d0 Support: utree_detail2: Fixes sign compare warning 2017-11-21 19:49:35 +03:00
Nikita Kniazev
b174d1f282 subrule: Fixed a huge use after scope bug
It took me 3 days of pulling my hair to debug and fix the bug. The subrule's
author put a big bomb under it and I caught the exposition only in a single
test, with modern versions of Clang/GCC and enabled optimizations (most of
boost regression test runners does not use `variant=release`). Valgrind did
not catch any problems. Enabling address sanitizer causes the bug to disappear
(now I understand why, it places big gaps between stack pointers).
`-fsanitize-address-use-after-scope` catches the bug, but I have discovered
that it is turned off in Clang by default after already having a repro.

The bug could be easily reproduced if you use any parser that invalidates
it's state in the destructor.

I used `literal_char` with added `~literal_char() { ch = char_type(0); }`.

Reproduction code:

```cpp

    rule<char const*> r;
    subrule<0> entry;
    r = (entry = 'a');
    BOOST_TEST(test("a", r));
```

It will fail because after assignment to `r` a temporary `subrule_group` is
destroyed and rule is binded to the already destroyed object.

The cause is in usage of `reference` parser. I am 100% sure the code was
copy-pasted from `rule`/`grammar`. They store an expression within their
body, while `subrule` actually used only as a placeholder.

I have split `subrule_group` into an actual parser/generator that stores the
expression and a Proto terminal that contains the parser/generator.

Tested on:
 - VS 2008, 2010, 2015, 2017
 - Clang 3.8, 3.9, 4.0, 5.0
 - GCC 4.8, 7
2017-11-21 00:37:54 +03:00
Nikita Kniazev
c7329ee8f5
Merge pull request #281 from Kojoley/fix-test-support-regression_multi_pass_position_iterator-msvc-9
Support.Tests: regression_multi_pass_position_iterator: Fixed MSVC 9 compilation
2017-11-16 02:52:14 +03:00
Nikita Kniazev
7310d850fc Support.Tests: regression_multi_pass_position_iterator: Fixed MSVC 9 compilation
Maybe will fix and MSVC 8 too. The fix found accidentally.
2017-11-16 02:50:02 +03:00
Nikita Kniazev
0f9c2d2be0
Merge pull request #280 from Kojoley/fix-qi-test-uint1-uint8_t-usage
Qi.Tests: uint1: Fixed `uint8_t` usage
2017-11-15 22:17:00 +03:00
Nikita Kniazev
2f68bc829f Qi.Tests: uint1: Fixed uint8_t usage
Fixes compilation problem on MSVC 8/9
2017-11-15 22:16:23 +03:00
Nikita Kniazev
457a6563a2
Merge pull request #279 from Kojoley/fix-subrules-partial-ordering-problem
Repository: subrule: Fixed partial ordering problem
2017-11-15 21:34:35 +03:00
Nikita Kniazev
fd10da52b7 Repository: subrule: Fixed partial ordering problem
The problem is that `f(T&)` and `f(T&&)` overloads had the same priority
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1164

Affected compilers are:
 - MSVC 9/10/11
 - GCC 4.7.2, 4.8.4 with `-std=c++1x`
2017-11-15 21:30:32 +03:00
Nikita Kniazev
1536ae3cec
Merge pull request #278 from Kojoley/fix-classic-test-bug_fixes-msvc-cxx17
Classic.Tests: bug_fixes: Fixed MSVC c++17 compile problem
2017-11-14 21:41:54 +03:00
Nikita Kniazev
c7d1560bc9 Classic.Tests: bug_fixes: Fixed MSVC c++17 compile problem 2017-11-14 21:40:45 +03:00
Nikita Kniazev
f168dcb356
Merge pull request #277 from Kojoley/fix-classic-ambiguous-std-and-spirit-namespaces
Classic: Fixed c++1z compilation problems
2017-11-14 00:38:39 +03:00
Nikita Kniazev
bb878087f7 Classic.Tests: traverse_tests: Fixed ambiguous optional 2017-11-14 00:35:43 +03:00
Nikita Kniazev
29281c68bb Classic.Tests: fundamental_tests: Fixed ambiguous optional 2017-11-14 00:35:43 +03:00
Nikita Kniazev
661c4319bd Classic.Tests: parser_traits_tests: Fixed ambiguous optional 2017-11-13 22:18:24 +03:00
Nikita Kniazev
19bf816734 Classic.Phoenix.Examples: Fixed Jamfile 2017-11-13 22:18:24 +03:00
Nikita Kniazev
1467257bee Classic.Phoenix.Examples: closures: Fixed ambiguous tuple 2017-11-13 22:18:23 +03:00
Nikita Kniazev
4ec785d3ed
Merge pull request #271 from Kojoley/fix-alternate
Spirit accidentally relays on `types` typedef of `boost::optional`
2017-11-13 17:21:40 +03:00
Nikita Kniazev
e91aa9f3a2
Merge pull request #259 from Kojoley/fix-subrule
Fix `subrule` compilation
2017-11-13 17:15:57 +03:00
Nikita Kniazev
8fd6f61c77
Merge pull request #276 from Kojoley/fix-classic-warnings
Classic: Fix multiple warnings
2017-11-12 21:22:43 +03:00
Nikita Kniazev
cdac069504 Classic: Fixed warning from isblank_ with bool scanner
While I do not see usages for `bool` scanner and consider it is a dumb idea
I have not removed the test. Adding the `isblank(bool)` overload seems to me
as a reasonable compromise because it cannot break anything.
2017-11-12 21:17:38 +03:00
Nikita Kniazev
24d7461950 Classic.Tests: scanner_value_type_tests: Fixed unused function warning 2017-11-12 18:59:53 +03:00
Nikita Kniazev
e21a75993d Classic.Tests: sf_bug_742038: Fixed temp file removing 2017-11-12 17:48:19 +03:00
Nikita Kniazev
66acd18baa Classic.Tests: multi_pass_compile_tests: Fixed deprecated unlink usage 2017-11-12 17:48:19 +03:00
Nikita Kniazev
3cfd69606c Classic.Tests: file_iterator_tests: Workarounded MSVC fopen warning 2017-11-12 17:48:19 +03:00
Nikita Kniazev
28a8dd0240 Classic.Tests: tree_to_xml: Fix implicit type conversion 2017-11-12 17:48:17 +03:00
Nikita Kniazev
5b2ab34506 Classic.Tests: symbols_add_null: Fixed unused typedef scanner 2017-11-12 17:28:58 +03:00
Nikita Kniazev
ffccc28780 Classic.Tests: parser_traits_tests: Fixed unused typedef plain_t 2017-11-12 17:28:00 +03:00
Nikita Kniazev
3de1c4bdaa Classic.Tests: tree_to_xml: Fixed unused typedefs 2017-11-12 17:28:00 +03:00
Nikita Kniazev
a9e7f574ee Classic: Fixed conversion from 'ptrdiff_t' to 'int', possible loss of data warnings 2017-11-12 17:15:16 +03:00
Nikita Kniazev
99134e9d7b
Merge pull request #275 from Kojoley/fix-classic-boost-optional-has-no-argument_type
Classic: Fixed compilation of `match<T &>`
2017-11-12 17:13:03 +03:00
Nikita Kniazev
632252bafc
Merge pull request #274 from Kojoley/fix-classic-phoenix-actor-remove_reference
Classic: Fix `remove_reference` usage without a namespace
2017-11-12 17:08:32 +03:00
Nikita Kniazev
85fa626071
Merge pull request #273 from Kojoley/fix-classic-phoenix-special_ops-complex
Classic: Fixed `std::complex` usage without the include
2017-11-12 17:07:38 +03:00
Nikita Kniazev
34ffa3315b
Merge pull request #272 from Kojoley/fix-classic-dynamic-for-unused-local-typedef-warning
Classic: Fixed unused local typedef in `dynamic/for.hpp`
2017-11-12 03:10:22 +03:00