<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 - base class template methods are not included in derived object method name resolution"
   href="https://bugs.llvm.org/show_bug.cgi?id=39581">39581</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>base class template methods are not included in derived object method name resolution
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>wl@gnu.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following MWEs both compile with g++ but not with clang.  This seems to be
a bug.

type parameters
---------------

struct Base {
 template <class T>
 void tmpl_method () { }
};

struct Derived : public Base {
 using Base::tmpl_method;

 template <class T, class X>
 void tmpl_method () { }
};

void foo () {
 Derived bar;
 bar.tmpl_method<int>();
}

(cf. <a href="https://godbolt.org/z/WpET78">https://godbolt.org/z/WpET78</a>)

-> <source>:15:6: error:
       no matching member function for call to 'tmpl_method'
    bar.tmpl_method<int>();
    ~~~~^~~~~~~~~~~~~~~~
   <source>:10:7: note:
       candidate template ignored:
       couldn't infer template argument 'X'
    void tmpl_method () { }
      ^

non-type parameters
-------------------

(cf. <a href="https://godbolt.org/z/PZIaDn">https://godbolt.org/z/PZIaDn</a>)

struct Base {
 template <int I>
 void tmpl_method () { }
};

struct Derived : public Base {
 using Base::tmpl_method;

 template <bool B>
 void tmpl_method () { }
};

void foo () {
 Derived bar;
 bar.tmpl_method<5>();
}

-> <source>:15:6: error:
       no matching member function for call to 'tmpl_method'
    bar.tmpl_method<5>();
    ~~~~^~~~~~~~~~~~~~

   <source>:10:7: note: candidate template ignored:
       invalid explicitly-specified argument for
       template parameter 'B'
    void tmpl_method () { }
         ^

The issue was discussed in a thread on the cfe-users mailing list starting with

  <a href="http://lists.llvm.org/pipermail/cfe-users/2018-November/001417.html">http://lists.llvm.org/pipermail/cfe-users/2018-November/001417.html</a></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>