Commit 7f70432
committed
[Format] Add format check for throwing negative numbers
Summary:
The code `throw -1;` is currently formatted by clang-format as
`throw - 1;`. This diff adds a fix for this edge case and a test to check
for this in the future.
For context, I am looking into a related bug in the clang-formatting of
coroutine keywords: `co_yield -1;` is also reformatted in this manner
as `co_yield - 1;`. A later diff will add these changes and tests for the
`co_yield` and `co_return` keywords.
Patch by Jonathan Thomas (jonathoma)!
Reviewers: modocache, sammccall, Quuxplusone
Reviewed By: sammccall
Subscribers: cfe-commits
Tags: #clang-format, #clang
Differential Revision: https://reviews.llvm.org/D69144
llvm-svn: 3752581 parent 80fe5cf commit 7f70432
File tree
2 files changed
+2
-1
lines changed- clang
- lib/Format
- unittests/Format
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1757 | 1757 | | |
1758 | 1758 | | |
1759 | 1759 | | |
1760 | | - | |
| 1760 | + | |
1761 | 1761 | | |
1762 | 1762 | | |
1763 | 1763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6912 | 6912 | | |
6913 | 6913 | | |
6914 | 6914 | | |
| 6915 | + | |
6915 | 6916 | | |
6916 | 6917 | | |
6917 | 6918 | | |
| |||
0 commit comments