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

    <tr>
        <th>Summary</th>
        <td>
            Missing case from "down with typename"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++20,
            clang:frontend
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          ilya-biryukov
      </td>
    </tr>
</table>

<pre>
    Found by looking at `g++.dg/cpp2a/typename16.C` from the GCC test suite.
Clang produces an error here:
```cpp
struct X { X(int); };
template<typename T> struct S {
  friend X::X(T::type);
  // <source>:3:13: error: qualified reference to 'X' is a constructor name rather than a type in this context
};
```
GCC and MSVC accept the code with no errors. See [godbolt](https://gcc.godbolt.org/z/xj8her1sK).

I believe Clang should accept this code without `typename` according to [(temp.res)p4.3](https://eel.is/c++draft/temp.res#general-4.3.3):
```
4. A qualified or unqualified name is said to be in a type-only context if it is the terminal name of
...
4.3 a decl-specifier of the decl-specifier-seq of a 
...
4.3.3 parameter-declaration in a member-declaration,125 unless that parameter-declaration appears in a default argument,
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VFGPmzgQ_jWTl1EQ2EDCAw9JtjmdTn3a6rSvxgzg1tjUNtvmfv3JONltez0pItieb-ab-T4jvFejIWqhOkP1tBNrmKxrlb6Jfafcbf1iX3ed7W_t1a6mx-6G2tovyowoAkKdj8DOwM5ZPwK7ymVhAtg13BYyYqaizi5Q5zg4O2OYCP-4XDCQD-hXFSiD_Any00ULM-LibL9K8igMknPW4USOgJ9SENR5-sllSTs-uFUGfEE4nPEF2FGZAKwBfkY4PAE_p7BA86JFIOCXBy38BPwD3vHPEZ9CEQenyPT4EsvyU0z6Kb1GaEr-CAV2BXZF4BdvVycJ-AfgJw78VMRH6iG-fF2FVoOiHh0N5MhIwmAR2OEF2AGVR4HSmkTHOtwYOhEmchgmY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