Consider the code below template<typename T> constexpr int foo(T) { return 0; }; template<> int foo(int) { return 1; } Compiling this code with g++-4.8.0 -Wall -c -std=c++0x bug.cpp throws the following error: bug.cpp:2:23: error: redeclaration ‘constexpr int foo(T) [with T = int]’ differs in ‘constexpr’ template<> int foo(int) { return 1; } ^ bug.cpp:1:36: error: from previous declaration ‘constexpr int foo(T) [with T = int]’ template<typename T> constexpr int foo(T) { return 0; }; Yet, the C++ standard (section 7.1.5) says that an explicit specialization can differ from the template declaration with respect to the constexpr specifier.
Seems easy.
Fixed for 4.9.0.