diff options
author | Emilia Dreamer <emilia@rymiel.space> | 2023-01-06 05:13:58 +0200 |
---|---|---|
committer | Emilia Dreamer <emilia@rymiel.space> | 2023-01-06 05:17:58 +0200 |
commit | b1eeec6177fafcc433d98c4f46f353b13c68aca0 (patch) | |
tree | 2d6206dc8c177c9ba33d8e64ddd382b8be8d5b94 /clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | |
parent | 54fab18cedace085344b674ab9de2c93b5fa479b (diff) | |
download | llvm-b1eeec6177fafcc433d98c4f46f353b13c68aca0.zip llvm-b1eeec6177fafcc433d98c4f46f353b13c68aca0.tar.gz llvm-b1eeec6177fafcc433d98c4f46f353b13c68aca0.tar.bz2 |
[clang-format] Remove special logic for parsing concept definitions.
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
Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D140339
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp')
0 files changed, 0 insertions, 0 deletions