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 14:29:59


#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 hkaiser):

 Replying to [comment:5 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.

 Yeah sure. If that works, it's fine.

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

 Indeed, I agree.

> 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.

 *sigh* - there isn't much we could do otherwise if the solution you
 suggested does not work.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8381#comment:6>
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