Opened 5 years ago

Closed 5 years ago

#13240 closed Bugs (fixed)

#include <boost/spirit/include/phoenix1.hpp> requires #include <complex> starting from boost 1.65.0

Reported by: anonymous Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.65.0 Severity: Regression
Keywords: Cc:

Description

Compiling

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

int main()
{
    return 0;
}

with

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.1/gcc-7.2.0/include -std=gnu++14

results in

In file included from /opt/wandbox/boost-1.65.0/gcc-7.2.0/include/boost/spirit/home/classic/phoenix.hpp:18:0,
                 from /opt/wandbox/boost-1.65.0/gcc-7.2.0/include/boost/spirit/include/phoenix1.hpp:11,
                 from prog.cc:1:
/opt/wandbox/boost-1.65.0/gcc-7.2.0/include/boost/spirit/home/classic/phoenix/special_ops.hpp:62:48: error: 'complex' is not a member of 'std'
 template <typename T> struct rank<PHOENIX_STD::complex<T> >
                                                ^~~~~~~
/opt/wandbox/boost-1.65.0/gcc-7.2.0/include/boost/spirit/home/classic/phoenix/special_ops.hpp:62:48: error: 'complex' is not a member of 'std'
/opt/wandbox/boost-1.65.0/gcc-7.2.0/include/boost/spirit/home/classic/phoenix/special_ops.hpp:62:57: error: template argument 1 is invalid
 template <typename T> struct rank<PHOENIX_STD::complex<T> >
                                                         ^
/opt/wandbox/boost-1.65.0/gcc-7.2.0/include/boost/spirit/home/classic/phoenix/special_ops.hpp:62:59: error: expected unqualified-id before '>' token
 template <typename T> struct rank<PHOENIX_STD::complex<T> >
                                                           ^

Workaround to the problem is to #include <complex> before phoenix1.hpp but this should be probably done internally.

On boost versions prior to 1.65.0 original code would compile w/o any errors (checked on wandbox.org).

Change History (3)

comment:1 by Kohei Takahashi, 5 years ago

Component: Nonespirit
Owner: set to Joel de Guzman

comment:2 by Nikita Kniazev <nok.raven@…>, 5 years ago

comment:3 by Joel de Guzman, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.