Re: [Boost-bugs] [Boost C++ Libraries] #8381: karma::uint_generator fails to compile in C++11 mode

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8381: karma::uint_generator fails to compile in C++11 mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-04 12:41:52


#8381: karma::uint_generator fails to compile in C++11 mode
--------------------------------------+-------------------------------------
  Reporter: andysem | Owner: hkaiser
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: spirit
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by andysem):

> The main question is: why is this happening in the first place? Is it
 because gcc 4.7 in C++11 mode overeagerly instantiates this function
 without need?

 It seems so, although I'm not sure it instantiates the whole function and
 not just static_assert. I didn't dig the standard to find out whether the
 compiler is supposed to behave that way (seems unlikely, though).

> If this is the case, then we can't do anything than to wrap it into a
 proper preprocessor condition.

 Does the trick with is_same look like a reasonable solution to you? I
 searched the code, there are quite a few similar asserts on false constant
 scattered. I could replace such cases with a new macro with this trick, if
 it's ok with you.

 If not, then I'm afraid, the only option is to ban static_assert for gcc,
 which is unfortunate.

 PS: I took a closer look at the code and it looks like removing the
 offending functions can result in less concise error messages, so I'm not
 considering this option.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8381#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC