Mixing constexpr declarations and const definitions
问题 I came across the following situation: struct Foo { static constexpr char s[] = "Hello world"; }; const char Foo::s[]; This code snippet compiles with Clang 3.7 (with -std=c++11 and -std=c++14 ), but GCC (4.8, 6.0, same language settings) gives the error I would have expected: GCC 4.8: in.cpp:6:19: error: redeclaration ‘Foo::s’ differs in ‘constexpr’ const char Foo::s[]; ^ in.cpp:3:27: error: from previous declaration ‘Foo::s’ static constexpr char s[] = "Hello world"; ^ in.cpp:6:19: error: