<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 - no diagnostic issued for invalid friend declaration involving dependent member of the current instantiation"
   href="https://bugs.llvm.org/show_bug.cgi?id=35377">35377</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>no diagnostic issued for invalid friend declaration involving dependent member of the current instantiation
          </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>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 (inspired by testcase for gcc.gnu.org/PR65157):

template<typename T> struct A {
  struct B;
  template<typename U> struct C;
};

template <typename T>
struct A<T>::B {
  template<typename U> void f();
};

template<typename T> template <typename U>
struct A<T>::C {
 friend void B::f<U>();
};

template<> struct A<int>::B {};
A<int>::C<int> c;


This crashes during IR generation. The root cause is that the friend
declaration was marked invalid without any diagnostic being issued. It *is*
invalid (we aren't supposed to be looking up things within B, because it's a
dependent type, so it can't be given template arguments with <...>), but we
should actually produce an error saying so.</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>