title: Unable to call a template member function of a template class from another template class
body: <p>I'm getting compiler errors when attempting to access a template member function of a template class from within another template class. A function call to <code>getSubmatrix</code> results in the compiler warnings, "expression result unused", about the parameters <code>(0, 0)</code>, finally failing with the compiler error "reference to non-static member function must be called".</p>
  
  <p>The matrix class:</p>
  
  <pre><code>template &lt;std::size_t m, std::size_t n, typename T, std::size_t rowPadding = 0&gt;
  class Matrix
  {
  public:
      ...
  
      template &lt;std::size_t p, std::size_t q&gt;
      Matrix&lt;p, q, T, n - q&gt;&amp; getSubmatrix(std::size_t column, std::size_t row)
      {
          ...
      }
  };
  </code></pre>
  
  <p>The transform class:</p>
  
  <pre><code>template &lt;typename T&gt;
  class Transform
  {
  public:
      ...
  
      Matrix&lt;4, 4, T&gt; matrix() const
      {
          ...
  
          Matrix&lt;4, 4, T&gt; result;
          result.getSubmatrix&lt;3, 3&gt;(0, 0) = Matrix&lt;3, 3, T&gt;();
  
          ...
      }
  };
  </code></pre>
  
  <p>Note that changing the matrix type to <code>Matrix&lt;4, 4, float&gt;</code> rather than <code>Matrix&lt;4, 4, T&gt;</code> will result in valid compilation. The compiler is clang 4.0 and the language version is C++11.</p>