r295003 - [CodeCompletion] Code complete the '__auto_type' keyword

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 15:35:59 PST 2017


Author: arphaman
Date: Mon Feb 13 17:35:59 2017
New Revision: 295003

URL: http://llvm.org/viewvc/llvm-project?rev=295003&view=rev
Log:
[CodeCompletion] Code complete the '__auto_type' keyword

rdar://29219185

Added:
    cfe/trunk/test/CodeCompletion/auto_type.c
Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=295003&r1=295002&r2=295003&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Mon Feb 13 17:35:59 2017
@@ -1334,8 +1334,9 @@ static void AddTypeSpecifierResults(cons
       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.

Added: cfe/trunk/test/CodeCompletion/auto_type.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/auto_type.c?rev=295003&view=auto
==============================================================================
--- cfe/trunk/test/CodeCompletion/auto_type.c (added)
+++ cfe/trunk/test/CodeCompletion/auto_type.c Mon Feb 13 17:35:59 2017
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -code-completion-at=%s:3:1 %s | FileCheck %s
+void func() {
+
+}
+// CHECK: COMPLETION: __auto_type




More information about the cfe-commits mailing list