Boost C++ Libraries: Ticket #8556: Cannot combine synthesized attributes with semantic actions in some cases https://svn.boost.org/trac10/ticket/8556 <p> The use of "%=" in rule definitions appears intended to permit simultaneous use of semantic actions and synthesized attributes. However, in some cases I find I can choose only one. In particular a rule of this form: </p> <p> rule&lt;Iterator, std::vector&lt;std::string&gt;()&gt; r; r = qi::string &gt;&gt; qi::string &gt;&gt; qi::string; </p> <p> successfully synthesizes its attribute, while the same rule defined this way: </p> <p> r = (qi::string &gt;&gt; qi::string &gt;&gt; qi::string)[SA] </p> <p> successfully compiles and runs its semantic action. However, combining them fails: </p> <p> r %= (qi::string &gt;&gt; qi::string &gt;&gt; qi::string)[SA] </p> <p> produces a compile error. Test case attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8556 Trac 1.4.3 Jeff Trull (@… Wed, 08 May 2013 23:56:26 GMT attachment set https://svn.boost.org/trac10/ticket/8556 https://svn.boost.org/trac10/ticket/8556 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">actiontest.cpp</span> </li> </ul> <p> standalone test case </p> Ticket Nikita Kniazev <nok.raven@…> Thu, 07 Dec 2017 16:48:33 GMT <link>https://svn.boost.org/trac10/ticket/8556#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8556#comment:1</guid> <description> <p> You should use <code>#define BOOST_SPIRIT_ACTIONS_ALLOW_ATTR_COMPAT</code> if you want your code to compile. </p> <p> The behavior you encountered is preserved to maintain the backward compatibility. <a class="ext-link" href="http://boost.2283326.n4.nabble.com/fusion-vector2-std-pair-compatibility-td3529649i20.html"><span class="icon">​</span>http://boost.2283326.n4.nabble.com/fusion-vector2-std-pair-compatibility-td3529649i20.html</a> </p> <p> There are also other ways to solve your problem <a class="ext-link" href="https://stackoverflow.com/questions/40723341/using-semantic-action-together-with-attribute-propagation-in-spirit"><span class="icon">​</span>https://stackoverflow.com/questions/40723341/using-semantic-action-together-with-attribute-propagation-in-spirit</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 13 Dec 2017 23:00:15 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8556#comment:2 https://svn.boost.org/trac10/ticket/8556#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