#
24761354 |
| 06-Sep-2022 |
Emilia Dreamer <emilia@rymiel.space> |
[clang-format] Change heuristic for locating lambda template arguments
Previously, the heuristic was simply to look for template argument- specific keywords, such as typename, class, template and au
[clang-format] Change heuristic for locating lambda template arguments
Previously, the heuristic was simply to look for template argument- specific keywords, such as typename, class, template and auto that are preceded by a left angle bracket <.
This changes the heuristic to instead look for a left angle bracket < preceded by a right square bracket ], since according to the C++ grammar, the template arguments must *directly* follow the introducer. (This sort of check might just end up being *too* aggressive)
This patch also adds a bunch more token annotator tests for lambdas, specifically for some of the stranger forms of lambdas now allowed as of C++20 or soon-to-be-allowed as part of C++23.
Fixes https://github.com/llvm/llvm-project/issues/57093
This does NOT resolve the FIXME regarding explicit template lists, but perhaps it gets closer
Differential Revision: https://reviews.llvm.org/D132295
show more ...
|
#
bd3dd10a |
| 05-Sep-2022 |
Emilia Dreamer <emilia@rymiel.space> |
[clang-format] Concepts: allow identifiers after negation
Previously, the formatter would refuse to treat identifiers within a compound concept definition as actually part of the definition, if they
[clang-format] Concepts: allow identifiers after negation
Previously, the formatter would refuse to treat identifiers within a compound concept definition as actually part of the definition, if they were after the negation operator !. It is now made consistent with the likes of && and ||.
Fixes https://github.com/llvm/llvm-project/issues/55898
Differential Revision: https://reviews.llvm.org/D131978
show more ...
|
#
c6e7752f |
| 05-Sep-2022 |
Emilia Dreamer <emilia@rymiel.space> |
[clang-format] Allow `throw` to be a keyword in front of casts
This makes throw more similar to return. However, unlike return, it has to more strict as to not remove spaces after usages of throw as
[clang-format] Allow `throw` to be a keyword in front of casts
This makes throw more similar to return. However, unlike return, it has to more strict as to not remove spaces after usages of throw as a (deprecated) exception specifier.
Fixes https://github.com/llvm/llvm-project/issues/57391
Differential Revision: https://reviews.llvm.org/D132762
show more ...
|
#
f54d42ab |
| 05-Sep-2022 |
Emilia Dreamer <emilia@rymiel.space> |
[clang-format] Don't put `noexcept` on empty line following constructor
With the AlwaysBreakTemplateDeclarations option, having a constructor template for a type consisting of all-uppercase letters
[clang-format] Don't put `noexcept` on empty line following constructor
With the AlwaysBreakTemplateDeclarations option, having a constructor template for a type consisting of all-uppercase letters with a noexcept specifier would put said noexcept specifier on its own blank line.
This is because the all-uppercase type is understood as a macro-like attribute (such as DEPRECATED()), and noexcept is seen as the declaration. However, noexcept is a keyword and cannot be an identifier on its own.
Fixes https://github.com/llvm/llvm-project/issues/56216
Differential Revision: https://reviews.llvm.org/D132189
show more ...
|
Revision tags: llvmorg-15.0.0 |
|
#
92d8738c |
| 01-Sep-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix a bug in merging blocks with a wrapped l_brace
When the opening brace of a control statement block is wrapped, we must check the previous line to determine whether to try to merge
[clang-format] Fix a bug in merging blocks with a wrapped l_brace
When the opening brace of a control statement block is wrapped, we must check the previous line to determine whether to try to merge the block.
Fixes #38639. Fixes #48007. Fixes #57421.
Differential Revision: https://reviews.llvm.org/D133093
show more ...
|
#
3bbdf06b |
| 30-Aug-2022 |
jackh <jackhuang1205@gmail.com> |
[clang-format] Fix annotating when deleting array of pointers
Fixes https://github.com/llvm/llvm-project/issues/57418
The token `*` below should be annotated as `UnaryOperator`.
``` delete[] *ptr;
[clang-format] Fix annotating when deleting array of pointers
Fixes https://github.com/llvm/llvm-project/issues/57418
The token `*` below should be annotated as `UnaryOperator`.
``` delete[] *ptr; ```
Reviewed By: owenpan, MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D132911
show more ...
|
#
bc10ab8d |
| 30-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix a bug in inserting braces at trailing comments
If the style wraps control statement braces, the opening braces should be inserted after the trailing comments if present.
Fixes #5
[clang-format] Fix a bug in inserting braces at trailing comments
If the style wraps control statement braces, the opening braces should be inserted after the trailing comments if present.
Fixes #57419.
Differential Revision: https://reviews.llvm.org/D132905
show more ...
|
#
f00f2b3e |
| 28-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix a bug in removing braces for the LLVM style
When an l_brace is wrapped and the line above it ends with a comment, the annotator adds ColumnLimit to the TotalLength of the l_brace,
[clang-format] Fix a bug in removing braces for the LLVM style
When an l_brace is wrapped and the line above it ends with a comment, the annotator adds ColumnLimit to the TotalLength of the l_brace, so the actual column position of the l_brace must be adjusted accordingly.
Fixes #57376.
Differential Revision: https://reviews.llvm.org/D132805
show more ...
|
#
44a06b51 |
| 26-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Rework removeBraces() in Format.cpp
Fixes #57373.
Differential Revision: https://reviews.llvm.org/D132719
|
Revision tags: llvmorg-15.0.0-rc3 |
|
#
2e361207 |
| 16-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix regressions in WhitespaceSensitiveMacros
Fixes #54522. Fixes #57158.
Differential Revision: https://reviews.llvm.org/D132001
|
#
41214456 |
| 18-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix BeforeHash indent of comments above PPDirective
Fixes #56326.
Differential Revision: https://reviews.llvm.org/D132097
|
#
777b6ad1 |
| 17-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Handle return type auto followed by l_paren
Fixes #57160.
Differential Revision: https://reviews.llvm.org/D132008
|
#
2185f647 |
| 16-Aug-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Handle comments between access specifier and colon
Fixes #56740.
Differential Revision: https://reviews.llvm.org/D131940
|
#
ef71383b |
| 13-Aug-2022 |
jackh <jackhuang1205@gmail.com> |
[clang-format] Distinguish logical and after bracket from reference
Fix commit `b646f0955574` and remove redundant code.
Differential Revision: https://reviews.llvm.org/D131750
|
Revision tags: llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1 |
|
#
4977fd21 |
| 28-Jul-2022 |
Denis Fatkulin <fatkulin.denis@huawei.com> |
[clang-format] Missing space between trailing return type 'auto' and left brace
There's no a space symbol between trailing return type `auto` and left brace `{`.
The simpliest examles of code to r
[clang-format] Missing space between trailing return type 'auto' and left brace
There's no a space symbol between trailing return type `auto` and left brace `{`.
The simpliest examles of code to reproduce the issue:
``` []() -> auto {} ```
and
``` auto foo() -> auto {} ```
Depends on D130299
Reviewed By: HazardyKnusperkeks, curdeius, owenpan
Differential Revision: https://reviews.llvm.org/D130417
show more ...
|
Revision tags: llvmorg-16-init |
|
#
892a9968 |
| 20-Jul-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Indent tokens after hash only if it starts a line
Fixes #56602.
Differential Revision: https://reviews.llvm.org/D130136
|
#
3c18a8b3 |
| 13-Jul-2022 |
Björn Schäpers <bjoern@hazardy.de> |
[clang-format] Indent TT_CtorInitializerColon after requires clauses
Fixes https://github.com/llvm/llvm-project/issues/56215
Differential Revision: https://reviews.llvm.org/D129942
|
#
a0458d92 |
| 16-Jul-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Never remove braces in macro definitions
Fixes #56559.
Differential Revision: https://reviews.llvm.org/D129921
|
#
8dd2ef21 |
| 15-Jul-2022 |
Krasimir Georgiev <krasimir@google.com> |
[clang-format] distinguish multiplication after brace-init from pointer
After https://github.com/llvm/llvm-project/commit/b646f0955574c6ad4c156c9db522e46f597cfda9, the added regression test started
[clang-format] distinguish multiplication after brace-init from pointer
After https://github.com/llvm/llvm-project/commit/b646f0955574c6ad4c156c9db522e46f597cfda9, the added regression test started being formatted as-if the multiplication `*` was a pointer. This adapts the heuristic to distinguish between these two cases.
Reviewed By: jackhong12, curdeius, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D129771
show more ...
|
#
6ab73071 |
| 14-Jul-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix invalid-code-generation by RemoveBracesLLVM
When removing an r_brace that is the first token of an annotated line, if the line above ends with a line comment, clang-format generat
[clang-format] Fix invalid-code-generation by RemoveBracesLLVM
When removing an r_brace that is the first token of an annotated line, if the line above ends with a line comment, clang-format generates invalid code by merging the tokens after the r_brace into the line comment.
Fixes #56488.
Differential Revision: https://reviews.llvm.org/D129742
show more ...
|
#
47bdf53a |
| 03-Jul-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Break on AfterColon only if not followed by comment
Break after a constructor initializer colon only if it's not followed by a comment on the same line.
Fixes #41128. Fixes #43246.
[clang-format] Break on AfterColon only if not followed by comment
Break after a constructor initializer colon only if it's not followed by a comment on the same line.
Fixes #41128. Fixes #43246.
Differential Revision: https://reviews.llvm.org/D129057
show more ...
|
#
40d2ef84 |
| 02-Jul-2022 |
owenca <owenpiano@gmail.com> |
[clang-format][NFC] Replace an EXPECT_EQ with a verifyFormat
|
#
b646f095 |
| 29-Jun-2022 |
Huang Zhen-Hong <jackhunag1205@gmail.com> |
[clang-format] Fix misplacement of `*` in declaration of pointer to struct
Fixes #55810
Differential Revision: https://reviews.llvm.org/D127873
|
Revision tags: llvmorg-14.0.6 |
|
#
7cb0bc8a |
| 13-Jun-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Handle more cases for RemoveBracesLLVM
Call mightFitOneOneline() on the line before the closing brace only if it is at the level of the block.
Differential Revision: https://reviews.
[clang-format] Handle more cases for RemoveBracesLLVM
Call mightFitOneOneline() on the line before the closing brace only if it is at the level of the block.
Differential Revision: https://reviews.llvm.org/D127614
show more ...
|
#
05d77102 |
| 10-Jun-2022 |
owenca <owenpiano@gmail.com> |
[clang-format] Fix a bug in RemoveBracesLLVM
Remove the braces of an else block only if the r_brace of the block is followed by an if.
Differential Revision: https://reviews.llvm.org/D127532
|