[Boost-bugs] [Boost C++ Libraries] #12473: Alternative parser inside permutation parser synthesizes uninitialized optional<>

Subject: [Boost-bugs] [Boost C++ Libraries] #12473: Alternative parser inside permutation parser synthesizes uninitialized optional<>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-09-20 23:15:35


#12473: Alternative parser inside permutation parser synthesizes uninitialized
optional<>
------------------------------+---------------------
 Reporter: edaskel@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------
 In the process of developing a grammar I discovered a strange behavior
 where combining alternative and permutation parsers with attributeless
 parsers can result in invalid optional<> objects. For example, using
 "eps" as an example of an attributeless parser:

 {{{
 ((int_ | eps) ^ eps)
 }}}

 is compatible with optional<int> and compiles successfully, but if you
 parse an input where the int is not present, an uninitialized optional<>
 is produced - it acts as though it stored an int, but the value is
 uninitialized (32766, 32765, or 32764, on my system).

 The expression:

 {{{
 (-int_ ^ eps)
 }}}

 also displays this behavior.

 I do have a workaround - using ''only'' the permutation parser works
 correctly.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12473>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC