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

    <tr>
        <th>Summary</th>
        <td>
            Poor diagnostic quality for operators that cannot be used as fold-operator
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
template <typename... Ts>
void awoo(Ts... args) {
    (args <=> ...);
}
```
For this code, clang outputs (https://godbolt.org/z/xozTW66rY):
```
<source>:3:15: error: expected expression
    3 |     (args <=> ...);
      | ^
```
There are also less than ideal diagnostics for `->` (and I assume, some other operators that cannot be folded over).

Presumably, this happens because `(args <=> ...)` is not parsed as a fold-expression at all, so you get some syntax error. It may be better to parse it as a fold-expression but immediately reject it with an error such as
> `<=>` is not a fold operator.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU81upDgQfpriUgoCu4Fw4NDT6ZbmNodIqz0aXGm8Mph1FUl6nn5l6GxGq4y0UjcY_PH9lKsMs7vORB1U36B6yswqY4jd2THNb-aVsj7YWwd1sf-GZYHiCYqj0LR4I4SgT3JbaDYT5XmOzwz6vENeg7No3kIA9fjMadPEK4NqEZpvOwQREdRjep-IQD-BPmOe56Ba0HcQNE_3xYeL_fESIsroGIdgCdQJB2_mK4ZVllU48Y4iC4M-grqAulyD7YOXPMQrqMtPUJf38PP5j7qOf25yxy9VQJ84rHGglEsfNehjWYE-IsUY4rZ4X2gQsmkRidmF-TOdRmhO-L9y4g5rTgjV-UsvzyNFQpP-ngN6YkYZzYzOkvFonbnOgcUNjC8hItTFQ3JdF5v4bPE7GuZ12qrFYSIMMlLEsFA0EuLGJjiYeQ6CPeFL8JYshleKoNr8bmq7_ojE62R6f0tk2zmMZlloZuxpMCtT0v9t6LpAx5hkFhOZLBpGs-k9fJYRjaDxfneLt7DilWQ3zrdZzPt-CDl-F5zMLTnuSYQiSth50cnXzP0q6KaJrDNC_oaR_qJBEvzNyYhm3qmR12FEwx-9cN5CfYT5JcWu8G8l88x22ra6NRl1ZVNWdVHXRZON3YH6Qdm-OuhD01RFY60tWtM0VFFbl5Yy16lCHYqq1KVWWjX5Y_tSFo3p-8e-Gh6LEg4FTcb53PvXKXVz5phX6tqyrdrMm548b-Os1ExvuG2CUmm6Y5e-eejXK8Oh8I6FP1nEiafuRwjxl07Cv1fjndy2hvptn6z3E9yq_IHK1ui7_4ygk3Ht8yFMoC5J-H57WGJI9Qd12ewyqMsW558AAAD__0tXa1o">