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

    <tr>
        <th>Summary</th>
        <td>
            Clang accepts invalid program involving decltype(classtype::memberfunction) when used with concepts
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    The following invalid program is accepted by clang trunk. https://godbolt.org/z/Ma67TTs5e

```
#include <iostream>
#include <type_traits> 
#include <concepts>
template < typename T >
concept test = std::same_as <decltype(T::func), int(int) >;
struct D
{
 int func(int);
};
int main()

    std::cout << test<D>; 
}
```
Note `decltype` on a non-static member function is not allowed and so it should be ill-formed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU8GOqzgQ_BpzaSVibCBw4DCTTG67p9xHjd0J3jV2ZDcZzX79yoRknt4bKXIM3VWqaqoxJXvxRL2o30R9KHDmMcQ-okf0IVyLIZiv_jQSnINz4dP6C1h_Q2cNXGO4RJzAJkCt6cpkYPgC7dBfgOPs_93CyHxNQr0KeRTyeAlmCI63IV6EPP4n5PEvbHanU6pJlAdRvq5nU66_-6NU1ms3GwKh9jYkjoSTUO8_lfnrSh8c0XIS6h1-atHBZ7XpycA0XR3yUoRM4HEiOMGzYUUAU2IQ6gCJTTalXhNO9IEpIw1pl8FCtqd78Tx7LWQn5B6sZyHb5ewWXvV2p04cZ81wWIXu1tcZAHf8inoixO7wvOeuCa0Xss0tD47VNgB8K9Vhztr3i0dKLNT-cBcC37w_jf_vkCfTlE9_TQnBA4IPfpMY2WqYaBooLoLZBp8j4QMD5siQAfQGUgDLkMYwOwMDgXVucw5xIrMtTK9MpzosqH9pWlUp1ZSyGPuWmvplQByaqjRdq9VwPje7qqsQ612pq8L2spSqrMtdWcmmklulh8oMitCcu7ZTtahKmtC6rXO3KeeusCnN1DeybuvC4UAuPbIf-9y0GeZLElXpbOL0DWPLjvr9ku172tOfi-Bvwd3yivySBe0wpeW-fIb7pB6Dymn4HMnDnMjAp-URHuks5uj639bH8jgPWx0mIY9Z2fq3ucbwD2kW8ri4S0IeF4P_BwAA__8gbDLY">