This revision was automatically updated to reflect the committed changes.
Closed by commit rL368280: [clang-format] fix crash involving invalid
preprocessor line (authored by krasimir, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
CH
krasimir marked an inline comment as done.
krasimir added inline comments.
Comment at: unittests/Format/FormatTest.cpp:3090
Style);
+ // Don't crash if there is nothing following #elif.
+ verifyFormat("#if 1\n"
gribozavr wrote:
> `// #elif direc
krasimir updated this revision to Diff 214115.
krasimir marked an inline comment as done.
krasimir added a comment.
- Apply review comments
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65940/new/
https://reviews.llvm.org/D65940
Files:
lib/Format/TokenAnnotato
gribozavr accepted this revision.
gribozavr added inline comments.
This revision is now accepted and ready to land.
Comment at: unittests/Format/FormatTest.cpp:3090
Style);
+ // Don't crash if there is nothing following #elif.
+ verifyFormat("#if 1\n"
--
krasimir created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This (invalid) fragment is crashing clang-format:
#if 1
int x;
#elif
int y;
#endif
The reason being that the parser expects a token after `#elif`, and the
subsequent parsing of the ne