llvm-project/clang/lib
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
..
ARCMigrate [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
AST [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
ASTMatchers Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Analysis [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
Basic [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
CodeGen [OpenMP] Adding support to the mutexinoutset dep-type 2019-02-04 07:33:19 +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 [NewPM] Add support for new-PM plugins to clang 2019-02-02 23:19:32 +00:00
Edit 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 [clang] Add getCommentHandler to PreambleCallbacks 2019-02-04 09:42:33 +00:00
FrontendTool [analyzer][NFC] Supply CheckerRegistry with AnalyzerOptions 2019-01-26 15:59:21 +00:00
Headers [CUDA] add support for the new kernel launch API in CUDA-9.2+. 2019-01-31 21:34:03 +00:00
Index Rename getTypeQualifiers to getMethodQualifiers. 2019-01-28 11:37:49 +00:00
Lex [CUDA][HIP] Do not diagnose use of _Float16 2019-01-29 13:20:23 +00:00
Parse [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +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 [Sema][ObjC] Allow declaring ObjC pointer members with non-trivial 2019-02-02 02:23:40 +00:00
Serialization [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
StaticAnalyzer [analyzer][UninitializedObjectChecker] New flag to ignore guarded uninitialized fields 2019-02-02 14:50:04 +00:00
Tooling [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00