Fixes http://llvm.org/PR10826.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139087
91177308-0d34-0410-b5e6-
96231b3b80d8
std::string Str = Lexer::Stringify(TokStr);
Result.append(Str.begin(), Str.end());
}
+ } else if (Tok.is(tok::code_completion)) {
+ PP.CodeCompleteNaturalLanguage();
} else {
// Otherwise, just append the token. Do some gymnastics to get the token
// in place and avoid copies where possible.
--- /dev/null
+const char *func(const char *);
+
+#define MORE __FILE__
+
+#define M(x) "1"#x
+#define N(x) func("2"#x MORE)
+
+void foo(const char *);
+
+int test() {
+ foo(M(x()));
+ foo(N(x()));
+}
+
+// RUN: c-index-test -code-completion-at=%s:11:11 %s | FileCheck %s
+// RUN: c-index-test -code-completion-at=%s:12:11 %s | FileCheck %s
+// CHECK: Natural language