llvm-project/clang/unittests/Format
Mitchell Balan 7ad60f6452 [clang-format] fix BreakBeforeBraces.MultiLine with for each macros
Summary:
The MultiLine option in BreakBeforeBraces was only handling standard
control statement, leading to invalid indentation with for each macros:

Previous behavior:

/* invalid: brace should be on the same line */
Q_FOREACH(int a; list)
{
    foo();
}

/* valid */
Q_FOREACH(int longVariable;
          list)
{
    foo();
}

To fix this, simply add the TT_ForEachMacro kind in the list of
recognized control statements for the multiline option.

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=44632

Reviewers: MyDeveloperDay, mitchell-stellar

Reviewed by: mitchell-stellar

Contributed by: vthib

Subscribers: cfe-commits

Tags: #clang, #clang-format, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D85304
2020-08-05 14:31:42 -04:00
..
CMakeLists.txt cmake: Add CLANG_LINK_CLANG_DYLIB option 2019-07-03 22:45:55 +00:00
CleanupTest.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTest.cpp [clang-format] fix BreakBeforeBraces.MultiLine with for each macros 2020-08-05 14:31:42 -04:00
FormatTestCSharp.cpp [clang-format] Microsoft style fixes for C# properties 2020-06-09 14:50:34 +01:00
FormatTestComments.cpp [clang-format] Fix AlignConsecutive on PP blocks 2020-05-13 18:31:51 +01:00
FormatTestJS.cpp [clang-format] Fix AlignOperands when BreakBeforeBinaryOperators is set 2020-05-15 16:40:31 +02:00
FormatTestJava.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestObjC.cpp [clang-format] Fix an ObjC regression introduced with new [[likely]][[unlikely]] support in if/else clauses 2020-05-26 18:48:49 +01:00
FormatTestProto.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestRawStrings.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestSelective.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestTableGen.cpp [clang-format][TableGen] Don't add spaces around items in square braces. 2019-03-01 00:12:18 +00:00
FormatTestTextProto.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestUtils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NamespaceEndCommentsFixerTest.cpp [clang-format] [PR46130] When editing a file with unbalance {} the namespace comment fixer can incorrectly comment the wrong closing brace 2020-05-30 13:15:27 +01:00
SortImportsTestJS.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SortImportsTestJava.cpp [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed 2019-10-01 20:20:22 +00:00
SortIncludesTest.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
UsingDeclarationsSorterTest.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00