<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 - name lookup in qualified friend declaration is extremely suspicious"
   href="https://bugs.llvm.org/show_bug.cgi?id=38882">38882</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>name lookup in qualified friend declaration is extremely suspicious
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </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>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Testcase:

using T = int;

namespace N {
  struct X {
    template<typename T> void f(T);
  };
  template<typename> struct Y {
    template<typename T> friend void X::f(T); // #1
    friend void X::f<>(Y); // #2
  };
}

Here, #1 resolves T as ::T, not as the template parameter. Strangely, we fail
to diagnose this, and instead silently befriend nothing in line #1.

In #2, Y resolves to N::Y, not to the injected-class-name of N::Y, and as a
result declaration #2 is rejected because Y is lacking its template arguments.

These results both seem extremely surprising. The standard's rules here are
highly unclear, but this cannot be the right behavior...</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>