Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#12142 closed Bugs (fixed)

Including optional/optional_fwd.hpp then type_traits.hpp

Reported by: Tony Lewis <tonyelewis@…> Owned by: akrzemi1
Milestone: Boost 1.62.0 Component: optional
Version: Boost 1.61.0 Severity: Regression
Keywords: config/suffix.hpp, type_traits, optional Cc:

Description

1.61.0 beta introduces a new problem: the following code has started failing to compile since 1.60.0:

#include <boost/optional/optional_fwd.hpp>
#include <boost/type_traits.hpp>

This appears to be caused by a change to optional_fwd.hpp so that it now includes boost/config/suffix.hpp. It turns out that that already had the potential to cause problems in 1.60.0, eg the following fails to compile:

#include <boost/config/suffix.hpp>
#include <boost/type_traits.hpp>

Does Boost.Config allow other Boost libraries to include boost/config/suffix.hpp directly? If so, I think Config needs to fix the above problem. If not, optional_fwd.hpp needs to be changed to include boost/config.hpp not boost/config/suffix.hpp (and in that case it might be good to do the following).

  1. scan for any other includes in any other Boost libraries
  2. fix them
  3. move suffix.hpp and similar in a detail subdirectory.

I'm seeing equivalent errors on both Clang 3.6.2-1 and GCC 5.2.1.

Command lines:

clang++ -std=c++11 -isystem /opt/boost_1_61_0_b1_clang_build/include a.cpp
g++     -std=c++11 -isystem /opt/boost_1_61_0_b1_gcc_build/include   a.cpp

Change History (5)

comment:1 by John Maddock, 6 years ago

Component: configoptional
Owner: changed from John Maddock to Fernando Cacciola

No way should optional be including an internal Config header directly - that's just not supported.

comment:2 by Tony Lewis <tonyelewis@…>, 6 years ago

I think this is related to ticket:12179.

comment:3 by akrzemi1, 6 years ago

Milestone: To Be DeterminedBoost 1.62.0
Owner: changed from Fernando Cacciola to akrzemi1

comment:4 by akrzemi1, 6 years ago

Resolution: fixed
Status: newclosed

comment:5 by Tony Lewis <tonyelewis@…>, 6 years ago

Yes - the develop branch of the boostorg/optional !GitHub repo now works for me.

Thanks very much for your work on this.

Note: See TracTickets for help on using tickets.