https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109763

            Bug ID: 109763
           Summary: GCC accepts invalid program involving
                    decltype(classtype::memberfunction) when used with
                    concepts
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following invalid program is accepted by gcc 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.

Reply via email to