llvm-project/clang/lib/Format
Emilia Dreamer 1fa115b569
[clang-format] Correctly indent closing brace of compound requires
When a compound requirement is too long to fit onto a single line, the
braces are split apart onto separate lines, and the contained expression
is indented. However, this indentation would also apply to the closing
brace and the trailing return type requirement thereof.
This was because the indentation level was being restored after all
trailing things were already read

With this change, the initial level of the opening brace is set before
attempting to read any trailing return type requirements

Fixes https://github.com/llvm/llvm-project/issues/57108

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D134626
2022-10-01 08:16:57 +03:00
..
.clang-format [clang-format][NFC] Reformat clang/lib/Format using 6257832bf9 2022-09-21 12:02:49 -07:00
AffectedRangeManager.cpp [clang-format][NFC] Insert/remove braces in clang/lib/Format/ 2022-05-24 19:06:04 -07:00
AffectedRangeManager.h
BreakableToken.cpp Use is_sorted (NFC) 2022-07-29 21:18:42 -07:00
BreakableToken.h [clang-format] Add option to control the spaces in a line comment 2021-02-01 22:48:50 +01:00
CMakeLists.txt [clang-format] Add MacroUnexpander. 2022-07-12 07:11:46 +00:00
ContinuationIndenter.cpp [clang-format] Handle Verilog case statements 2022-07-29 00:38:30 +00:00
ContinuationIndenter.h [clang-format][NFC] Replace most of std::vector with SmallVector 2022-07-13 16:45:22 -07:00
DefinitionBlockSeparator.cpp [clang-format][NFC] Insert/remove braces in clang/lib/Format/ 2022-05-24 19:06:04 -07:00
DefinitionBlockSeparator.h [clang-format] Fix SeparateDefinitionBlocks issues 2022-01-24 14:23:20 +00:00
Encoding.h
Format.cpp [clang-format] Wrap inserted braces only if preceded by comments 2022-09-20 12:09:39 -07:00
FormatInternal.h
FormatToken.cpp [clang] adds unary type transformations as compiler built-ins 2022-08-22 03:03:32 +00:00
FormatToken.h [clang] adds unary type transformations as compiler built-ins 2022-08-22 03:03:32 +00:00
FormatTokenLexer.cpp [clang] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 09:12:46 -07:00
FormatTokenLexer.h [clang-format] Handle Verilog numbers and operators 2022-07-29 00:38:29 +00:00
MacroCallReconstructor.cpp [clang-format][NFC] Reformat clang/lib/Format using 6257832bf9 2022-09-21 12:02:49 -07:00
MacroExpander.cpp [clang-format] Elide unnecessary braces. NFC. 2022-02-02 14:36:01 +01:00
Macros.h [clang-format][NFC] Replace most of std::vector with SmallVector 2022-07-13 16:45:22 -07:00
NamespaceEndCommentsFixer.cpp [clang-format] Fix namespace format when the name is followed by a macro 2022-03-10 15:00:32 -08:00
NamespaceEndCommentsFixer.h
QualifierAlignmentFixer.cpp Remove redundant initialization of Optional (NFC) 2022-08-20 21:18:28 -07:00
QualifierAlignmentFixer.h [clang-format] Fix a crash (assertion) in qualifier alignment when matching template closer is null 2022-01-06 19:40:39 +00:00
SortJavaScriptImports.cpp [clang-format][NFC] Insert/remove braces in clang/lib/Format/ 2022-05-24 19:06:04 -07:00
SortJavaScriptImports.h
TokenAnalyzer.cpp [clang-format] Skip token annotation in passes that don't need it 2022-09-18 11:19:40 -07:00
TokenAnalyzer.h [clang-format] Skip token annotation in passes that don't need it 2022-09-18 11:19:40 -07:00
TokenAnnotator.cpp [clang-format][NFC] Reformat clang/lib/Format using 6257832bf9 2022-09-21 12:02:49 -07:00
TokenAnnotator.h [clang-format] Fix template arguments in macros 2022-09-16 13:30:46 +00:00
UnwrappedLineFormatter.cpp [clang-format] Fix a bug in merging blocks with a wrapped l_brace 2022-09-02 21:38:36 -07:00
UnwrappedLineFormatter.h [NFC][clang-format] Fix typo 2022-08-29 09:34:05 +08:00
UnwrappedLineParser.cpp [clang-format] Correctly indent closing brace of compound requires 2022-10-01 08:16:57 +03:00
UnwrappedLineParser.h [clang-format] Fix template arguments in macros 2022-09-16 13:30:46 +00:00
UsingDeclarationsSorter.cpp [clang-format] Use ranged for loops. NFC. 2022-02-01 14:10:48 +01:00
UsingDeclarationsSorter.h
WhitespaceManager.cpp [clang-format] Fix alignment in #else preprocessor blocks 2022-09-27 15:41:09 -04:00
WhitespaceManager.h [clang-format] Minimize the damage caused by AlignArrayOfStructures when working on non square arrays 2022-03-12 17:22:31 +00:00