From 288e8b831e9a9ede7e1d68aa282489a7fae86154 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Mon, 13 Feb 2017 23:35:59 +0000 Subject: [PATCH] [CodeCompletion] Code complete the '__auto_type' keyword rdar://29219185 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295003 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaCodeComplete.cpp | 5 +++-- test/CodeCompletion/auto_type.c | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test/CodeCompletion/auto_type.c diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 0056b1138d..9b71a3f087 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -1334,8 +1334,9 @@ static void AddTypeSpecifierResults(const LangOptions &LangOpts, Builder.AddChunk(CodeCompletionString::CK_RightParen); Results.AddResult(Result(Builder.TakeString())); } - } - + } else + Results.AddResult(Result("__auto_type", CCP_Type)); + // GNU extensions if (LangOpts.GNUMode) { // FIXME: Enable when we actually support decimal floating point. diff --git a/test/CodeCompletion/auto_type.c b/test/CodeCompletion/auto_type.c new file mode 100644 index 0000000000..3fcfff0dcf --- /dev/null +++ b/test/CodeCompletion/auto_type.c @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -code-completion-at=%s:3:1 %s | FileCheck %s +void func() { + +} +// CHECK: COMPLETION: __auto_type -- 2.40.0