[Development] Compiling with GCC 4.8

Olivier Goffart olivier at woboq.com
Wed Mar 27 18:20:50 CET 2013

On Wednesday 27 March 2013 11:20:21 David Narvaez wrote:
> On Wed, Mar 27, 2013 at 9:51 AM, Thiago Macieira
> <thiago.macieira at intel.com> wrote:
> > 1) I don't want fixes to issues that don't make it to the release of that
> > compiler. If you can find in the standard saying the new behaviour is
> > correct,
> > then fine. But otherwise, it might be a compiler bug that gets fixed
> > before the
> > release. We don't need the churn in our code.
> In this particular case, the situation was a semantic problem with our
> code that GCC 4.8 would no longer allow, so it was clearly not a
> compiler bug. In those situations, maybe we can agree to make sure the
> patch goes to the release branch too.

I don't think the problem was in our code.
I beleive GCC 4.8 Is wrong.

The C++11 standard § 7.5.1 1  says:
  [ Note: An explicit specialization can differ from the template declaration  
     with respect to the constexpr specifier. — end note ] 

Which I read that this explicitly allows code like this:

template<typename T> constexpr int foo(T) { return 0; };
template<> int foo(int) { return 1; }

So the bug should be reported to GCC if it still do not compile with the 4.8 

(Note:  this does not mean it was a bad idea to work around the bug)


Woboq - Qt services and support - http://woboq.com - http://code.woboq.org

More information about the Development mailing list