<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85773>85773</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Tree way comparism detected as clang format violation.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
hruskape
</td>
</tr>
</table>
<pre>
Minimal peace of code taken from [1]
```
struct Point
{
int x;
int y;
auto operator<=>(const Point&) const = default;
// ... non-comparison functions ...
};
```
With clang-format version 16.0.6, no problem detected.
With clang-format version 17.0.5 following error is printed.
Tool suggested modification render code not to be possible to compile.
```
clang-format --dry-run test.cpp
./test.cpp:5:20: error: code should be clang-formatted [-Wclang-format-violations]
auto operator<=>(const Point&) const = default;
^
./test.cpp:5:21: error: code should be clang-formatted [-Wclang-format-violations]
auto operator<=>(const Point&) const = default;
^
FAILED clang-format found errors!
```
[1] https://en.cppreference.com/w/cpp/language/default_comparisons
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUVEGPqzYQ_jXmMgIZOyTkwCG7LFKlVurhSe9YGXsg7jMeZJvd7r-vCMlm86o-9dDLiyJjD_jz930zYxWjHT1iw6onVrWZWtKZQnMOS_ymZsx6Mu_Nb9bbSTmYUWkEGkCTQUjqG3oYAk3AqqeSVS3jLeOn67jn1_9lGVNYdILfyfp0_eDwtE0AAKxP8BeT30XeHyJqSQQ0Y1CJApPPTLZMvjBRa_LxBi32TBxhizDZgsFBLS7dgZjomOigKArw5HNN06yCjeRhWLxOlnxcX944th87vxO0jV9tOoN2yo_5QGFSCV4xREseyn3Biz0Tz-AJ5kC9wwkMJtQJTfEfMQ4FLyoYyDl6s34EDIEC2AhzsH7FgQ3iC5GDuIwjxoQGJjJ2sFqtaiCgNxi2lHlKkAh6hJlitL3Ddbl6YB0WP0jfA708N-E9D4uHhDEVep4_7yyY6D7i8lQxeRKcydNGfp1cqMQzLc6sVD5jr-xZ9ZR__RzMXy25i5j4UWT_X0H888eql3-XUv5UUu5autMvv760j3U20OLNJiYyUf4g_9dxa3M4pzRHJk9bL6Ff_Qk4YECvsdA0MdG9MdGttoluPXFRIzLRXRn_ce-6mJlGmqM8qgyb8lDyelfz6pidm4Mx6sDRiN4MXArNuah7ceS1rrg8cpnZRnCx47I8lqXclcfioOtqx0XNeWlqvtuzHcdJWVc49zoVFMbMxrhgU1eHg8yc6tHFy70nxMUWJgQTz7fV1aQ1WLVZaFaQvF_GyHbc2ZjiHTbZ5C436MPGqoUvARHe1DvcBN-vAFBxSwbcmv5WGUW2BNc8ejzadF76q7XruddHPgf6E3Viortoi0x0F3l_BwAA___Ivca0">