<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Bogus error/note about dependent base classes on template instantiation failure"
   href="https://bugs.llvm.org/show_bug.cgi?id=48339">48339</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bogus error/note about dependent base classes on template instantiation failure
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>wtt6@cornell.edu
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The below code is invalid (the template parameter of g cannot be deduced), but
before giving the correct error clang reports

bug.cpp:11:5: error: use of undeclared identifier 'g'
    g(typename T::type{});
    ^
    this->
bug.cpp:16:7: note: in instantiation of function template specialization
'S::f<X>' requested here
  S{}.f<X>();
      ^
bug.cpp:7:15: note: must qualify identifier to find this declaration in
dependent base class
  static void g(typename T::type) {}

which make no sense as there are no base classes here, dependent or otherwise. 
These messages are not present if g is not marked static.


struct X {
  struct type {};
};

struct S {
  template <typename T>
  static void g(typename T::type) {}

  template <typename T>
  void f() {
    g(typename T::type{});
  }
};

void f() {
  S{}.f<X>();
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>