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

    <tr>
        <th>Summary</th>
        <td>
            clang-format fail to properly format conditional operator
        </td>
    </tr>

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

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

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

<pre>
    ```c++
#include <compare>
#include <iostream>

struct Rational {
  int num;
  int den;

 constexpr bool operator==(Rational const &) const = default;
};

constexpr std::weak_ordering operator<=>(Rational lhs, Rational rhs) {
  return lhs.num * rhs.den <=> lhs.den * rhs.num;
}

void print(std::weak_ordering value) {
  value < 0 ? std::cout << "less\n" : 
  value > 0 ? std::cout << "greater\n"
 : std::cout << "equal\n";
}

int main() {
  Rational a{6, 5}, b{8, 7};
  print(a <=> b);
}
```

The above code clang-format will format it into this:
```c++
#include <compare>
#include <iostream>

struct Rational {
  int num;
 int den;

  constexpr bool operator==(Rational const &) const = default;
};

constexpr std::weak_ordering operator<=>(Rational lhs, Rational rhs) {
  return lhs.num * rhs.den <=> lhs.den * rhs.num;
}

void print(std::weak_ordering value) {
  value<0 ? std::cout << "less\n" : value> 0 ? std::cout << "greater\n"
 : std::cout << "equal\n";
}

int main() {
  Rational a{6, 5}, b{8, 7};
 print(a <=> b);
}
```

In function `print`, clang-format consider the `<>` as template brace, but that is not the case.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsVd2K8zYQfZrxzbBBlhL_XPgim2ygt6X3RbYmsVpZSvWz2-_ti7zexLt8oZQWSqEgElszc86ZkU4iQ9AXS9TB7hl2x0KmODrfDQ2di96pbx1U7H0NwJ_zYkdge-BC28EkRQjiMLjpKj2BePleVLsQPcnpHp4_Q_RpiPijjNpZaRDqBRtR24g2TSA-7Siyt51lf3A2RPr96rF3zqC7kpfReRDHvHhzA58TEXgFvP14EUdUdJbJxDtsffxCcWcIUYHYg9i_kfz1Z-cVeW0vK87DTPuypjVjAH649-jze7tu1VNM3ubEjU0TAt_npI0iizfEOTrvLNH1bLLkld5XpxVevbYRePNA8qs0ib7omPcyJTIEcbp3O7gU36UcEDg3FALsDhY4RxB7_Fr_8if1F08ykl8gluoM9KiAfkvSfKQ_aDrfjklqC7z50tZt8hLq5yqfxS7X8gP2UD83-aFeHzreZidX8--Bt9_h_nDGWspPI6Hs3Svh4BThYKS9PJ2dn2TEN20MLs865jvtMI465L4_I_6bXntgtf-99s96DcThrzltqfqvG-xv-usHi-dkh0yKULF3tIplnk9ey3dJK_IYR8qJM9kLVAxlwEjT1chI2Hs50Cw2RYxj9mVA6-JcNchAm0J1QrWilQV1ZVVvy5I3u7YYO9mWaisFk1tZq7aUajeIrSrbvi_7bdmLQnecccHKsmU1Z7t2UzZn1VR1IypWlfXQw5bRJLXZGPM6bZy_FDqERF3Fyi0rjOzJhPlvmXNLbzgH8xntjoXvcs1Tny4BtszoEMMdJepoqPs0jbPUBqPDq88WMt_wPiWllwP8MFeRvOnGGK_z7xI_AT9ddBxTvxncBPyUeZavp6t3v9AQgZ9mdQH4aVb_RwAAAP__mj1lvQ">