Issue 71684
Summary "is not a structural type" should be a substitution failure
Labels
Assignees
Reporter ecatmur
    On CE trunk 20231108 18.0.0 (https://github.com/llvm/llvm-project.git fb07d9cc096f4a0c2473dee064c427edc2a83157):
```c++
template<auto> struct test {};
template<class T> concept structural = requires { []<T x>(test<x>) {}; };
class C { int i; };
static_assert(not structural<C>);
```
(reduced from https://stackoverflow.com/a/68856187/567292)

fails with hard error:
```
<source>:2:56: error: type 'C' of non-type template parameter is not a structural type
    2 | template<class T> concept structural = requires { []<T x>(test<x>) {}; };
      | ^
<source>:2:51: note: while substituting into a lambda _expression_ here
    2 | template<class T> concept structural = requires { []<T x>(test<x>) {}; };
      | ^
<source>:2:51: note: in instantiation of requirement here
    2 | template<class T> concept structural = requires { []<T x>(test<x>) {}; };
      | ^~~~~~~~~~~~~~~~~~~
<source>:2:40: note: while substituting template arguments into constraint _expression_ here
 2 | template<class T> concept structural = requires { []<T x>(test<x>) {}; };
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:4:19: note: while checking the satisfaction of concept 'structural<C>' requested here
    4 | static_assert(not structural<C>);
      | ^~~~~~~~~~~~~
<source>:3:15: note: 'C' is not a structural type because it has a non-static data member that is not public
    3 | class C { int i; };
      |               ^
1 error generated.
Compiler returned: 1
```

Previously (13.0.0 through 17.0.1) this was a substitution failure, which I think it should be.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to