title: Initializing a static constexpr data member of the base class by using a static constexpr data member of the derived class
body: <p>Consider the following code:</p>
  
  <pre><code>template&lt;typename T&gt;
  struct S { static constexpr int bar = T::foo; };
  
  struct U: S&lt;U&gt; { static constexpr int foo = 42; };
  
  int main() { }
  </code></pre>
  
  <p><a href="https://godbolt.org/g/xDmBPW" rel="noreferrer">GCC v6.1</a> compiles it, <a href="https://godbolt.org/g/CQMXaJ" rel="noreferrer">clang 3.8</a> rejects it with the error:</p>
  
  <blockquote>
    <p>2 : error: no member named 'foo' in 'U'<br>
    struct S { static constexpr int bar = T::foo; };</p>
  </blockquote>
  
  <p>Which compiler is right?<br>
  Could it be due to the fact that <code>U</code> <a href="http://eel.is/c++draft/class#class.mem-6" rel="noreferrer">is not a complete type</a> at the point where we try to use it within <code>S</code>?<br>
  In this case, it should be considered a bug of GCC, but I'd like to know if I'm right before to search/open an issue on the bug tracker...</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Meanwhile I've opened a <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71534" rel="noreferrer">bug</a> to GCC.<br>
  Waiting for it to accept the answer.</p>