title: Clang++-3.7 CRTP compilation error "no named member" in parent's template argument
body: <p>In the below code I am trying to use CRTP to use the static member "value" from the Child class in the Parent class. When compiling the code with g++ 5.2.1 with the "-pedantic" flag, I am able to compile as expected, and on execution both <code>c.print_value();</code> and <code>Child&lt;int,4&gt;::print_value();</code> print out 4. </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template &lt;typename DE&gt;
  struct Parent
  {
      static const int value = DE::value;
      static void print_value ()
      {
          std::cout &lt;&lt; "Value : " &lt;&lt; value &lt;&lt; '\n';
      }
  };
  
  template &lt;typename T, int N&gt;
  struct Child : Parent&lt; Child&lt;T,N&gt; &gt;
  {
      static const int value = N;
  };
  
  int
  main ()
  {
      Child&lt;int,4&gt; c;
      c.print_value();
      Child&lt;int,4&gt;::print_value();
  }
  </code></pre>
  
  <p>However when compiling the same code with clang++3.7, I encounter compilation failures.</p>
  
  <pre><code>crtp_clang_error.cpp:9:32: error: no member named 'value' in 'Child&lt;int, 4&gt;'
  static const int value = DE::value;
                         ~~~~^
  crtp_clang_error.cpp:27:16: note: in instantiation of template class 'Parent&lt;Child&lt;int, 4&gt; &gt;' requested here
  struct Child : Parent&lt; Child&lt;T,N&gt; &gt;
             ^
  crtp_clang_error.cpp:38:16: note: in instantiation of template class 'Child&lt;int, 4&gt;' requested here
    Child&lt;int,4&gt; c;
             ^
  crtp_clang_error.cpp:40:3: error: no member named 'print_value' in 'Child&lt;int, 4&gt;'; did you mean 'Parent&lt;Child&lt;int, 4&gt; &gt;::print_value'?
    Child&lt;int,4&gt;::print_value();
    ^~~~~~~~~~~~~~~~~~~~~~~~~
    Parent&lt;Child&lt;int, 4&gt; &gt;::print_value
  crtp_clang_error.cpp:11:15: note: 'Parent&lt;Child&lt;int, 4&gt; &gt;::print_value' declared here
    static void print_value ()
  </code></pre>
  
  <p>I am not sure if this a Clang++ bug or a GCC hack. Would very much appreciate some insights.</p>