[Development] Compiling with GCC 4.8

David Narvaez david.narvaez at computer.org
Mon Apr 8 07:43:16 CEST 2013


On Wed, Mar 27, 2013 at 12:20 PM, Olivier Goffart <olivier at woboq.com> wrote:
> 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
> release.
>
>
> (Note:  this does not mean it was a bad idea to work around the bug)

Thanks for the clarification, I reported the bug[0] - just fixed the
section number to 7.1.5. Your sample code compiles fine in Clang, btw.

David E. Narváez



More information about the Development mailing list