summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Lex/PPDirectives.cpp6
-rw-r--r--clang/test/CodeCompletion/ordinary-name.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index ee8883b8b26..3414c27bfc8 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1046,6 +1046,12 @@ bool Preprocessor::ConcatenateIncludeName(
while (CurTok.isNot(tok::eom)) {
End = CurTok.getLocation();
+ // FIXME: Provide code completion for #includes.
+ if (CurTok.is(tok::code_completion)) {
+ Lex(CurTok);
+ continue;
+ }
+
// Append the spelling of this token to the buffer. If there was a space
// before it, add it now.
if (CurTok.hasLeadingSpace())
diff --git a/clang/test/CodeCompletion/ordinary-name.c b/clang/test/CodeCompletion/ordinary-name.c
index 0807b74b12c..dda7bb018a0 100644
--- a/clang/test/CodeCompletion/ordinary-name.c
+++ b/clang/test/CodeCompletion/ordinary-name.c
@@ -12,3 +12,6 @@ void foo() {
// CHECK-CC1: foo
// CHECK-CC1: TYPEDEF
// CHECK-CC1: y
+
+ // PR8744
+ // RUN: %clang_cc1 -isystem %S/Inputs -fsyntax-only -code-completion-at=%s:1:11 %s
OpenPOWER on IntegriCloud