llvm-project/clang/test/CodeCompletion/crash-if-directive.cpp
Kadir Cetinkaya 761f3d1675
[clang][PreProcessor] Cutoff parsing after hitting completion point
This fixes a crash caused by Lexers being invalidated at code
completion points in
https://github.com/llvm/llvm-project/blob/main/clang/lib/Lex/PPLexerChange.cpp#L520.

Differential Revision: https://reviews.llvm.org/D102069
2021-05-10 11:24:27 +02:00

7 lines
175 B
C++

#define FOO(X) X
#if FOO(
#elif FOO(
#endif
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:2:9 %s
// RUN: not %clang_cc1 -fsyntax-only -code-completion-at=%s:3:11 %s