1 //  Copyright (c) 2010 Josh Wilson
2 //  Copyright (c) 2001-2010 Hartmut Kaiser
3 //
4 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
5 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 
7 #include <boost/config/warning_disable.hpp>
8 #include <boost/spirit/include/qi.hpp>
9 #include <boost/fusion/include/adapt_struct.hpp>
10 #include <boost/variant.hpp>
11 #include <string>
12 
13 namespace qi = boost::spirit::qi;
14 
15 ///////////////////////////////////////////////////////////////////////////////
16 struct Number { float base; };
17 
18 BOOST_FUSION_ADAPT_STRUCT( Number, (float, base) )
19 
instantiate1()20 void instantiate1()
21 {
22       qi::symbols<char, Number> sym;
23       qi::rule<std::string::const_iterator, Number()> rule;
24       rule %= sym;  // Caused compiler error after getting r61322
25 }
26 
27 ///////////////////////////////////////////////////////////////////////////////
28 typedef boost::variant<int, float> internal_type;
29 
30 struct Number2 { internal_type base; };
31 
32 BOOST_FUSION_ADAPT_STRUCT( Number2, (internal_type, base) )
33 
instantiate2()34 void instantiate2()
35 {
36       qi::symbols<char, Number2> sym;
37       qi::rule<std::string::const_iterator, Number2()> rule;
38       rule %= sym;  // Caused compiler error after getting r61322
39 }
40 
41