llvm-project/clang/unittests
Krasimir Georgiev 4fc55a76b8 [clang-format] Fix crash while reflowing backslash in comments
Summary:
The added test case was currently crashing with an assertion:
```
krasimir@krasimir> cat test.cc                                                                                                                                                              ~
// How to run:
// bbbbb run \
// rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr \
// <log_file> -- --output_directory="<output_directory>"
krasimir@krasimir> ~/work/llvm-build/bin/clang-format test.cc                                                                                                                               ~
clang-format: /usr/local/google/home/krasimir/work/llvm/tools/clang/lib/Format/WhitespaceManager.cpp:117: void clang::format::WhitespaceManager::calculateLineBreakInformation(): Assertion `PreviousOriginalWhitespaceEndOffset <= OriginalWhitespaceStartOffset' failed.
```
The root cause was that BreakableToken was not considering the case of a reflow between an unescaped newline in a line comment.

Subscribers: cfe-commits

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

llvm-svn: 334527
2018-06-12 19:33:15 +00:00
..
AST [ASTImporter] Corrected lookup at import of templated record decl 2018-05-30 09:19:26 +00:00
ASTMatchers [ASTMatchers] Introduce a blockDecl matcher for matching block declarations 2018-05-16 22:47:03 +00:00
Analysis [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Basic Disable an in-memory vfs file path test on windows. 2018-05-24 13:52:48 +00:00
CodeGen Unit tests for TBAA metadata generation. 2017-12-22 15:22:45 +00:00
CrossTU IWYU for llvm-config.h in clang. See r331124 for details. 2018-04-30 13:52:15 +00:00
Driver s/LLVM_ON_WIN32/_WIN32/, clang 2018-04-27 19:11:14 +00:00
Format [clang-format] Fix crash while reflowing backslash in comments 2018-06-12 19:33:15 +00:00
Frontend Fix build - use llvm::make_unique 2018-06-06 08:25:54 +00:00
Lex Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective' 2018-05-10 19:05:36 +00:00
Rename Unittests misc. typos 2018-02-06 13:12:29 +00:00
Rewrite [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Sema Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>" 2018-02-27 15:54:55 +00:00
StaticAnalyzer Unittests misc. typos 2018-02-06 13:12:29 +00:00
Tooling [clang][tooling] Don't forget to link to clangToolingInclusions. 2018-06-04 12:04:41 +00:00
libclang [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00