The following C++11 program produces an undefined reference to S<42>::s
error in both gcc and clang...
#include <iostream>
template<int i> struct S;
template<> struct S<42> { static constexpr char s[] = "foo"; };
int main()
{
std::cout << S<42>::s << std::endl;
}
By adding the following extra declaration (related question) to the program...
constexpr char S<42>::s[];
...it suppresses the error, and the program compiles.
Where in the standard does it specify that a program without that extra declaration is ill-formed? Which rules are in play here exactly?