llvm-project/clang/unittests
Krasimir Georgiev 20bef459fc [clang-format] Fix breaking of qualified operator
Summary:
From https://bugs.llvm.org/show_bug.cgi?id=40516
```
$ cat a.cpp
const NamespaceName::VeryLongClassName &NamespaceName::VeryLongClassName::myFunction() {
  // do stuff
}

const NamespaceName::VeryLongClassName &NamespaceName::VeryLongClassName::operator++() {
  // do stuff
}
$ ~/ll/build/opt/bin/clang-format -style=LLVM a.cpp
const NamespaceName::VeryLongClassName &
NamespaceName::VeryLongClassName::myFunction() {
  // do stuff
}

const NamespaceName::VeryLongClassName &NamespaceName::VeryLongClassName::
operator++() {
  // do stuff
}
```
What was happening is that the split penalty before `operator` was being set to
a smaller value by a prior if block. Moved checks around to fix this and added a
regression test.

Reviewers: djasper

Reviewed By: djasper

Tags: #clang

Differential Revision: https://reviews.llvm.org/D57604

llvm-svn: 353033
2019-02-04 09:56:16 +00:00
..
AST [ASTImporter] Fix up test that only works on X86. 2019-02-02 08:31:22 +00:00
ASTMatchers [CUDA] add support for the new kernel launch API in CUDA-9.2+. 2019-01-31 21:34:03 +00:00
Analysis [clang] add tests to ExprMutAnalyzer that reproduced a crash in ASTMatchers 2019-01-21 13:26:18 +00:00
Basic [FileManager] Revert r347205 to avoid PCH file-descriptor leak. 2019-01-24 18:55:24 +00:00
CodeGen Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CrossTU Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Format [clang-format] Fix breaking of qualified operator 2019-02-04 09:56:16 +00:00
Frontend Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Index Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Lex Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Rename Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Rewrite Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sema [CodeComplete] Propagate preferred types through parser in more cases 2019-01-31 20:20:32 +00:00
StaticAnalyzer Accomodate gcc 7.3.0's -Wdangling-else 2019-01-31 15:26:03 +00:00
Tooling [Tooling] Handle #pragma once header guard in include insertion. 2019-01-29 14:40:01 +00:00
libclang Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [Index] Add an option to collect macros from preprocesor. 2018-09-18 08:51:08 +00:00