llvm-project/clang/lib/Format
Krasimir Georgiev 6a1c9d51fa [clang-format] Fix regression about short functions after #else
Summary:
This patch fixes a regression introduced in r312904, where the formatter confuses
the `else` in `#else` with an `else` of an `if-else` statement.
For example, formatting this code with google style
```
#ifdef A
int f() {}
#else
int f() {}
#endif
```
resulted in
```
#ifdef A
int f() {}
#else
int f() {
}
#endif
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

llvm-svn: 314683
2017-10-02 15:53:37 +00:00
..
AffectedRangeManager.cpp Added Fixer implementation and fix() interface in clang-format for removing redundant code. 2016-04-25 15:09:22 +00:00
AffectedRangeManager.h removed redundant '#' 2016-04-28 07:52:06 +00:00
BreakableToken.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
BreakableToken.h [clang-format] Put '/**' and '*/' on own lines in jsdocs ending in comment pragmas 2017-08-09 09:42:32 +00:00
CMakeLists.txt [clang-format] Support sorting using declarations 2017-06-21 12:03:12 +00:00
ContinuationIndenter.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
ContinuationIndenter.h [clang-format] Refactor WhitespaceManager and friends 2017-01-31 11:25:01 +00:00
Encoding.h [Format] Remove dead code. 2016-12-19 21:10:50 +00:00
Format.cpp [clang-format] Add ext/ to google include categories 2017-09-26 14:58:29 +00:00
FormatToken.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
FormatToken.h clang-format clang-format. 2017-09-20 09:51:03 +00:00
FormatTokenLexer.cpp clang-format/java: Unbreak genenrics formatting after r299952. 2017-09-27 17:57:50 +00:00
FormatTokenLexer.h [clang-format] Handle NSString literals by merging tokens. 2017-04-11 09:55:00 +00:00
NamespaceEndCommentsFixer.cpp [clang-format] Fix FixNamespaceComments when BraceWrapping AfterNamespace is true. 2017-09-27 07:51:51 +00:00
NamespaceEndCommentsFixer.h [clang-format] Add a NamespaceEndCommentsFixer 2017-02-27 13:28:36 +00:00
SortJavaScriptImports.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
SortJavaScriptImports.h clang-format: [JS] sort ES6 imports. 2016-05-20 11:24:24 +00:00
TokenAnalyzer.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
TokenAnalyzer.h [Format] Remove dead code. 2016-12-19 21:10:50 +00:00
TokenAnnotator.cpp clang-format/java: Unbreak genenrics formatting after r299952. 2017-09-27 17:57:50 +00:00
TokenAnnotator.h [clang-format] Add a NamespaceEndCommentsFixer 2017-02-27 13:28:36 +00:00
UnwrappedLineFormatter.cpp [clang-format] Fix regression about short functions after #else 2017-10-02 15:53:37 +00:00
UnwrappedLineFormatter.h clang-format clang-format. 2017-09-20 09:51:03 +00:00
UnwrappedLineParser.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
UnwrappedLineParser.h clang-format clang-format. 2017-09-20 09:51:03 +00:00
UsingDeclarationsSorter.cpp [clang-format] Ignore case and stable sort using-declarations 2017-09-22 04:48:17 +00:00
UsingDeclarationsSorter.h [clang-format] Support sorting using declarations 2017-06-21 12:03:12 +00:00
WhitespaceManager.cpp clang-format clang-format. 2017-09-20 09:51:03 +00:00
WhitespaceManager.h [Format] Invert nestingAndIndentLevel pair in WhitespaceManager used for 2017-08-25 19:14:53 +00:00