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

    <tr>
        <th>Summary</th>
        <td>
            C23 restrict-on-array rejected
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf page 120 (6.7.4 Type qualifiers, Constraints):
> Types other than pointer types whose referenced type is an object  type and (possibly multi-dimensional) array types with such pointer types as element type shall not be restrict-qualified.

Thus: `int *` can be restricted, as can `(int *)[10]` and `(int *)[10][10]`.

Clang agrees with the former, and
```c
int *restrict x[1];
```
works, but
```c
typedef int *t[1];
restrict t x;
```
is rejected as
```
$ cc -std=c23 a.c -c
a.c:2:1: error: restrict requires a pointer or reference ('t' (aka 'int *[1]') is invalid)
    2 | restrict t x;
      | ^
```

Debian clang version 19.0.0 (++20240422112300+a2692ac23f14-1\~exp1\~20240422112407.665).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VFuS4yoMXY3yo4oLy6_4wx95TFYwG8BYiekhkAHcmb4fd-23IEn33K7uVMo2SDrnCAnJEPTZMg_Q7KA5rOQSZ-cHK0f9ItU_hm9s9Gp009swx3gNUG2BjkDH2-1WuCvbdYhT4fwZ6PgSVQl0DIooOZzL-u4HdJycCkBHWxGJ4jqd8CrPjCUJBNq0RVfU-PPtyvh7kUafNPsAtMe9syF6qW0MQH2iFgcQW6h-ZO-ALs7sMc7S4tVpG9MiG26zC4yeT-zZKp7yNuqA0qIbX1hFvG9JOyUJVxeCHs0bXhYT9XrSF7ZBOysNUI_Se_n2RNZxxrCo-ROjDMiGL2zjHTjM0hi0LuKYhITotYrrZ35T8UglP3_OSzpYhFZoGxFoC61AJe3fsTylI5Eh70MrgDZPZ-qh2ZUCmkOKyyl9Z__w-5-CvZH2jPLs-ZlinBlPzl_YZ1o7Pdxbcf-r-_pB8RSJfxJDIqh2nwLuy5vzv3JtxyV-jZhOb-ITPpDjZ8B3qkT2DYsO6DlVmSeU4UsXoBqVwtS-UB0UVSgLheuHCFkoqLYE1bZMhWHvnU8f7-Sefy_ap7q_94HzHw2Xegqoi0Bd-pS_JAJ1z3o8MqIuNZcOqO2rNHpKdcrsiIiE0O3xy2Qx_5IZmh9fJ5efBx61tKhybV_Zp4bGsi9EIe76dkA7ElSLmqgsqRICaCep7Ukqqk5lvS6h2f_Lf675_ZdrLbqibRugvlhNQzX1VS9XPJRd2VJLou9W87CR3PVtWbUVlVU3yrYfaUNKjp3cdNPptNJDRmyoFBVtyq4oxdhumo66um-obxTUgi9Sm8KY10saMisdwsJDT5u6Wxk5sgl5cBFZvmE2AlGaY35IMetxOQeohdEhhg-UqKPhYU_Vx8V0dn2_5c--WS3efBp5Zx3nZSyUuwAdE9jjtb56l4KAjllCmnRZ4n8BAAD__6c3lC0">