Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#11223 closed Bugs (fixed)

Context does not properly check support for std::integer_sequence

Reported by: Emile Cormier Owned by: olli
Milestone: To Be Determined Component: context
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

When I build Boost 1.58 with C++11 support on GCC 4.8.2, it fails to build the context library. This is due to the library attempting to use std::index_sequence:

In file included from libs/context/src/execution_context.cpp:11:0:
./boost/context/execution_context.hpp:202:52: error: ‘std::index_sequence’ has not been declared

std::index_sequence is a feature only available in C++14.

A workaround would be:

  1. First build a C++11-enabled Boost using the --without-context option
  2. Build the missing context library using --with-context, making sure that -std=c++11 is NOT added to the cxxflags

My platform is GCC 4.8.2, x86_64-linux-gnu, Linux Mint 17 (based on Ubuntu 14.04)

Attachments (1)

log.txt (11.5 KB ) - added by anonymous 8 years ago.

Download all attachments as: .zip

Change History (10)

by anonymous, 8 years ago

Attachment: log.txt added

comment:1 by olli, 8 years ago

Class execution_context can only be compiled with C++-14 - the code uses test macros for several C++11/C++14 features in order to enable building class execution_context. Unfortunately, boost is missing a test macro for 'std::index_sequence'. I already requested for supporting the required macro.

comment:2 by olli, 8 years ago

Component: contextconfig
Owner: changed from olli to Beman Dawes

comment:3 by olli, 8 years ago

please re-assign if macro is available

comment:4 by olli, 8 years ago

I've added a pull-request for boost.config (https://github.com/boostorg/config/pull/57) - which solves the problem for GCC and CLANG. Unfortunately I'm not familiar with the other compiler (maybe defining BOOST_NO_CXX14_INTEGER_SEQUENCE per default at first).

comment:5 by olli, 8 years ago

Component: configcontext

comment:6 by olli, 8 years ago

Owner: changed from Beman Dawes to olli

comment:7 by olli, 7 years ago

Resolution: fixed
Status: newclosed

test of

defined(__cpp_lib_integer_sequence) && (__cpp_lib_integer_sequence < 201304)
Last edited 7 years ago by olli (previous) (diff)

comment:8 by Emile Cormier, 7 years ago

Has this fix been pushed to GitHub yet?

comment:9 by Emile Cormier, 7 years ago

Nevermind, I found your latest Boost.Config PR: https://github.com/boostorg/config/pull/58

Thank you for fixing this! :-)

While I wait for the next Boost release, can I simply add -DBOOST_NO_CXX14_INTEGER_SEQUENCE while building Boost to avoid the compiler errors I originally reported?

Note: See TracTickets for help on using tickets.