llvm-project/clang/unittests
Mitchell Balan d45aafa2fb [clang-format] fix conflict between FormatStyle::BWACS_MultiLine and BeforeCatch/BeforeElse
Summary:
Found a bug introduced with BraceWrappingFlags AfterControlStatement MultiLine. This feature conflicts with the existing BeforeCatch and BeforeElse flags.

For example, our team uses BeforeElse.

if (foo ||
    bar) {
  doSomething();
}
else {
  doSomethingElse();
}

If we enable MultiLine (which we'd really love to do) we expect it to work like this:

if (foo ||
    bar)
{
  doSomething();
}
else {
  doSomethingElse();
}

What we actually get is:

if (foo ||
    bar)
{
  doSomething();
}
else
{
  doSomethingElse();
}

Reviewers: MyDeveloperDay, Bouska, mitchell-stellar

Patch by: pastey

Subscribers: Bouska, cfe-commits

Tags: clang

Differential Revision: https://reviews.llvm.org/D71939
2020-01-06 09:21:41 -05:00
..
AST Customize simplified dumping and matching of LambdaExpr 2019-12-21 11:02:11 +00:00
ASTMatchers Clang-format previous commit 2020-01-05 22:58:32 +00:00
Analysis [CFG] Fix an assertion failure with static initializers 2019-12-23 16:35:37 -08:00
Basic [clang-format] Remove duplciate code from Invalid BOM detection 2019-10-24 20:24:44 +01:00
CodeGen Added 'inline' to functions defined in headers to avoid ODR violations 2019-08-29 16:58:13 +00:00
CrossTU [Tooling] Migrated APIs that take ownership of objects to unique_ptr 2019-08-30 09:29:34 +00:00
DirectoryWatcher Use ASSERT_THAT_ERROR instead of logAllUnhandledErrors/exit 2019-08-09 06:14:54 +00:00
Driver [Clang] Bypass distro detection on non-Linux hosts 2019-11-28 17:02:06 -05:00
Format [clang-format] fix conflict between FormatStyle::BWACS_MultiLine and BeforeCatch/BeforeElse 2020-01-06 09:21:41 -05:00
Frontend [FrontendTests] Try again to make test not write an output file 2019-10-22 08:44:34 +00:00
Index [NFC] Fix typos in Clangd and Clang 2019-12-16 10:54:40 +01:00
Lex [clang-scan-deps] do not skip empty #if/#elif in the minimizer to avoid missing `__has_include` dependencies 2019-12-02 18:47:22 -08:00
Rename cmake: Add CLANG_LINK_CLANG_DYLIB option 2019-07-03 22:45:55 +00:00
Rewrite [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug 2019-08-15 21:17:48 +00:00
Sema [CodeComplete] Fix a crash in preferred type and signature help 2019-12-11 09:43:28 +01:00
Serialization cmake: Add CLANG_LINK_CLANG_DYLIB option 2019-07-03 22:45:55 +00:00
StaticAnalyzer [analyzer][NFC] Fix inconsistent references to checkers as "checks" 2019-09-12 19:09:24 +00:00
Tooling [Syntax] Build spanning SimpleDecalration for classes, structs, etc 2020-01-03 12:33:11 +01:00
libclang [libclang] Fix UninstallAbortingLLVMFatalErrorHandler test 2019-09-12 23:51:48 +00:00
CMakeLists.txt [clang] [unittest] Import LLVMTestingSupport if necessary 2019-09-12 13:06:12 +00:00