title: cannot override static initialization in derived class
body: <p>i'm trying to provide different static initializations for classes in a hierarchy, but when i tried with this code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  struct base {
  static const char* componentName;
  };
  const char* base::componentName = "base";
  
  struct derived : public base {};
  
  const char* derived::componentName = "derived";
  
  int main() {
  
  cout &lt;&lt; base::componentName &lt;&lt; endl;
  cout &lt;&lt; derived::componentName &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I ended up with this build error:</p>
  
  <pre><code>test.cpp:15: error: ISO C++ does not permit ‘base::componentName’ to be defined as ‘derived::componentName’
  test.cpp:15: error: redefinition of ‘const char* base::componentName’
  test.cpp:11: error: ‘const char* base::componentName’ previously defined here
  </code></pre>
  
  <p>It seems that static initializations cannot be overriden on the derived classes? If this does not work i might always define the componentName to be a static function that returns a const char*, the only problem with that i was sort of hoping to do initializations for partial specializations, and there does not seem to be any way that i know of to redefine just a single function in a partial specialization, without copying all the other code that will remain mostly the same</p>