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

    <tr>
        <th>Summary</th>
        <td>
            "is not a structural type" should be a substitution failure
        </td>
    </tr>

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

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

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

<pre>
    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.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVk1v4zgP_jXKhZjAlvx58CHjNsB7evcw9wUt07G2tpWVqHZ62d--kN00nWmD2bksZoXAgQSRfB6SIonem9NC1Ij8s8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