llvm-project/clang/unittests
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
..
AST [clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp 2020-08-05 14:13:05 +01:00
ASTMatchers On Windows build, making the /bigobj flag global , instead of passing it per file. 2020-07-28 18:04:36 -05:00
Analysis Assignment and Inc/Dec operators wouldn't register as a mutation when Implicit Paren Casts were present 2020-06-09 19:45:57 +01:00
Basic [clang][Preprocessor] Replace the slow translateFile call by a new, faster isMainFile check 2020-05-14 14:13:34 -07:00
CodeGen [AIX] Temporarily disable IncrementalProcessingTest partially 2020-07-30 10:41:52 -04:00
CrossTU [clang][NFC] Add a missing 'override' 2020-07-17 17:35:59 -07:00
DirectoryWatcher [DirectoryWatcher] Fix misuse of FSEvents API and data race 2020-02-11 09:25:38 -08:00
Driver Reland: [clang driver] Move default module cache from system temporary directory 2020-06-27 05:35:15 -04:00
Format [clang-format] fix BreakBeforeBraces.MultiLine with for each macros 2020-08-05 14:31:42 -04:00
Frontend Ensure that CompilerInvocationTest normalizes default target triples 2020-06-25 10:41:40 +01:00
Index [clang][Index] Visit the default parameter arguements in libindex. 2020-02-17 16:45:04 +01:00
Lex [clang] Make sure argument expansion locations are correct in presence of predefined buffer 2020-04-22 21:01:52 +02:00
Rename [OpenMP] "UnFix" layering problem with FrontendOpenMP 2020-04-07 14:41:18 -05:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema Use libClangTesting in the unittest for AST matchers 2020-06-04 17:40:39 +02:00
Serialization Revert "[modules] Do not cache invalid state for modules that we attempted to load." 2020-03-10 10:59:26 -07:00
StaticAnalyzer [analyzer] Fix out-of-tree only clang build by not relaying on private header 2020-07-31 10:28:14 +02:00
Tooling [SyntaxTree] Add test coverage for `->*` operator 2020-08-05 07:36:39 +00:00
libclang Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
CMakeLists.txt Use INTERFACE_COMPILE_OPTIONS to disable -Wsuggest-override for any target that links to gtest 2020-07-27 08:37:01 -07:00