This is a trivial follow-up to r361461, so sending without review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361510
91177308-0d34-0410-b5e6-
96231b3b80d8
static void AddLambdaCompletion(ResultBuilder &Results,
llvm::ArrayRef<QualType> Parameters,
const LangOptions &LangOpts) {
+ if (!Results.includeCodePatterns())
+ return;
CodeCompletionBuilder Completion(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
// [](<parameters>) {}
// RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:50:35 %s -o - | FileCheck -check-prefix=CHECK-6 %s
// CHECK-6-NOT: COMPLETION: Pattern : [<#=
}
+
+void test5() {
+ // Completions are only added when -code-completion-patterns are enabled.
+ function<void()> b = {};
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-patterns -code-completion-at=%s:57:24 %s -o - | FileCheck -check-prefix=CHECK-7 %s
+ // CHECK-7: COMPLETION: Pattern : [<#=
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:57:24 %s -o - | FileCheck -check-prefix=CHECK-8 %s
+ // CHECK-8-NOT: COMPLETION: Pattern : [<#=
+}