<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57636>57636</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Class in function in template class forgets this in clang-cl
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Alcaro
      </td>
    </tr>
</table>

<pre>
    ```c++
template<typename T>
struct outer {
        auto foo() {
                struct inner {
                        int m_member = 42;
                        int bar() {
                                return m_member;
                        }
                };
                return inner{};
        }
};

void baz() {
        outer<int>().foo().bar();
}
```
Compile with clang-cl or -fdelayed-template-parsing. <https://godbolt.org/z/4Mbco54o4>

Expected: Compiles correctly, like in MSVC

Actual: `error: 'outer<int>::foo()::inner::bar()::inner::m_member' is not a member of class 'inner'`

Originally found by @InfRandomness at <https://github.com/Thalhammer/asyncpp/pull/5>
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VE2PmzAQ_TXmYgURG_By4JAmu1IPq0rtqtfKGANujY1ss1v66ztAwm7SqNJgPJ6vN28sV7aeSpQnqwhEPs2SnFByCLIfNA8S0WOYBml4L_ELoo-r1Qc3ioDtGKTDiJ1jUFLwMVjcWIvIAyLFlQnkHKaMuQlbRZmA-x-97KvZTE84JYjec6q4u19gFSfD6MyW6t8ciJ2uTkC99jlnWIDOJW4ctvCr83l9taoGeH_uwFvIAjqhgZnHxSHeqIq3nt4zbmUuE1rVo-0HpSV-U6HDQnPT7oTG1uFdU0vNJ1nvLtPbDdx5ZdoY6Dx2IQwe0QMiTyCtrSurQ2xdCxoAfkqfK2Gz1KbbmNf18fcgRZA1hOJzbY-FdQ5O9YTIEWv1SwJZ-Pnb9-PHyIMII9dzHICXzlm37Am74QIw0cNGxaqu3C_bD9TcWLYRE4aVx8YGzPH5AtlmJsf7ud4aQtjG4bp-capVhms9wZ0dDUxuwihNPpvmKze17Y2EcB7ukAfUj1UsbA_KS8d1x_t-rvDE_WTEMMBuGLWGXwYNRrLc5znJWQZfVJe0LmjBo6CCluVxAQnsNaMRQdn52uHLAM8tNDAlGTwOnVpcL1OPRqfL_0DT-vXy2w3O_oSJgaq8H6WfsbGc5lFXVpSleSP2WVbTuklTme8LUTFWp_ucNIJFmldS-xJl8EAQI9_wkgL2KDtFqiQJIUmRPBCyTwmL86QpBE0ZFeKBJUICpbLnSsczjvnCRa5cIFVj68GolQ_-3QgNq9ZIuZSD_PCmdNaVBy24s9FSuVyQ_wWBQGN1">