Opened 11 years ago

Closed 11 years ago

#5780 closed Bugs (fixed)

Boost.Fusion adapted class boost::rational<long> causes compile errors in Boost.Spirit.Karma rules

Reported by: Torsten Maehne <Torsten.Maehne@…> Owned by: Hartmut Kaiser
Milestone: To Be Determined Component: spirit
Version: Boost 1.47.0 Severity: Problem
Keywords: BOOST_FUSION_ADAPT_CLASS, BOOST_FUSION_ADAPT_ADT Cc:

Description

The attached test case compiled and worked correctly until Boost 1.44 using BOOST_FUSION_ADAPT_CLASS to adapt boost::rational<long> to a Fusion sequence used in a Karma output rule. With Boost 1.45, BOOST_FUSION_ADAPT_CLASS has been replaced with BOOST_FUSION_ADAPT_ADT. According to Boost.Spirit documentation (cf. Karma - Writing Generators -> Tutorials -> Complex - Fully Integrated), the semantics haven't changed despite the name change:

http://www.boost.org/doc/libs/1_47_0/libs/spirit/doc/html/spirit/karma/tutorials/karma_adapted_complex.html

(The referred documentation page contains a small error, as it still mentions BOOST_FUSION_ADAPT_CLASS instead of BOOST_FUSION_ADAPT_ADT.)

The test case causes with Boost 1.45 till Boost trunk compile errors. The compiler output log is attached.

Attachments (2)

test_boost_fusion_adaption_with_karma.cpp (3.7 KB ) - added by Torsten Maehne <Torsten.Maehne@…> 11 years ago.
Test case
test_boost_fusion_adaption_with_karma.log (171.5 KB ) - added by Torsten Maehne <Torsten.Maehne@…> 11 years ago.
Compiler error log

Download all attachments as: .zip

Change History (4)

by Torsten Maehne <Torsten.Maehne@…>, 11 years ago

Test case

by Torsten Maehne <Torsten.Maehne@…>, 11 years ago

Compiler error log

comment:1 by Joel de Guzman, 11 years ago

Owner: changed from Joel de Guzman to Hartmut Kaiser

comment:2 by Hartmut Kaiser, 11 years ago

Resolution: fixed
Status: newclosed

Adding

    #include <boost/spirit/include/support_adapt_adt_attributes.hpp>

will make your test case compile fine (with SVN trunk and V1.47).

Thanks for the doc bug report, I will fix it asap.

Note: See TracTickets for help on using tickets.