Previously, clang-format relied on a special method to parse concept
definitions, UnwrappedLineParser::parseConcept(), which deferred to
UnwrappedLineParser::parseConstraintExpression(). This is problematic,
because the C++ grammar treats concepts and requires clauses
differently, causing issues such as https://github.com/llvm/llvm-project/issues/55898 and https://github.com/llvm/llvm-project/issues/58130.
This patch removes parseConcept, letting the formatter parse concept
definitions as more like what they actually are, fancy bool definitions.
NOTE that because of this, some long concept definitions change in their
formatting, as can be seen in the changed tests. This is because of a
change in split penalties, caused by a change in MightBeFunctionDecl on
the concept definition line, which was previously true but with this
patch is now false.
One might argue that false is a more "correct" value for concept
definitions, but I'd be fine with setting it to true again to maintain
compatibility with previous versions.
Fixes https://github.com/llvm/llvm-project/issues/58130
Depends on D140330
Does this change anything, besides the penalties and by that the wrapping?
While I can live with both, I think we should not format code differently, if it's not by a bugfix.