Boost C++ Libraries: Ticket #12473: Alternative parser inside permutation parser synthesizes uninitialized optional<> https://svn.boost.org/trac10/ticket/12473 <p> 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&lt;&gt; objects. For example, using "eps" as an example of an attributeless parser: </p> <pre class="wiki">((int_ | eps) ^ eps) </pre><p> is compatible with optional&lt;int&gt; and compiles successfully, but if you parse an input where the int is not present, an uninitialized optional&lt;&gt; is produced - it acts as though it stored an int, but the value is uninitialized (32766, 32765, or 32764, on my system). </p> <p> The expression: </p> <pre class="wiki">(-int_ ^ eps) </pre><p> also displays this behavior. </p> <p> I do have a workaround - using <em>only</em> the permutation parser works correctly. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12473 Trac 1.4.3 edaskel@… Tue, 20 Sep 2016 23:16:29 GMT attachment set https://svn.boost.org/trac10/ticket/12473 https://svn.boost.org/trac10/ticket/12473 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">optional_issue_reduced.cpp</span> </li> </ul> <p> reduced testcase </p> Ticket Nikita Kniazev <nok.raven@…> Fri, 08 Dec 2017 16:47:36 GMT <link>https://svn.boost.org/trac10/ticket/12473#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12473#comment:1</guid> <description> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/spirit/pull/319"><span class="icon">​</span>https://github.com/boostorg/spirit/pull/319</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 13 Dec 2017 22:59:41 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12473#comment:2 https://svn.boost.org/trac10/ticket/12473#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket