]> granicus.if.org Git - clang/commitdiff
Class template (partial) specializations should not show up in code completion results
authorDouglas Gregor <dgregor@apple.com>
Fri, 11 Dec 2009 16:18:54 +0000 (16:18 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 11 Dec 2009 16:18:54 +0000 (16:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91125 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCodeComplete.cpp
test/CodeCompletion/templates.cpp

index 73e0ab0fadebbb89f8e8541669efef8e33d61b83..63c8bdcc6c20bfd9c9b2c577422cad8ea1cda8d8 100644 (file)
@@ -363,6 +363,11 @@ void ResultBuilder::MaybeAddResult(Result R, DeclContext *CurContext) {
   if (isa<FriendDecl>(CanonDecl) || 
       (IDNS & (Decl::IDNS_OrdinaryFriend | Decl::IDNS_TagFriend)))
     return;
+
+  // Class template (partial) specializations are never added as results
+  if (isa<ClassTemplateSpecializationDecl>(CanonDecl) ||
+      isa<ClassTemplatePartialSpecializationDecl>(CanonDecl))
+    return;
   
   if (const IdentifierInfo *Id = R.Declaration->getIdentifier()) {
     // __va_list_tag is a freak of nature. Find it and skip it.
index d35e0bb8dcdea93c857c7915dd7fc8b6d33de225..5a0bdb19f15c0ef640173701504b859b70139202 100644 (file)
@@ -2,15 +2,15 @@ namespace std {
   template<typename T>
   class allocator;
   
-  template<typename T, typename Alloc = std::allocator<T> >
-  class vector;
+  template<typename T, typename Alloc = std::allocator<T> > class vector;
+  template<typename Alloc> class vector<bool, Alloc>;
 }
 
 void f() {
   std::
   // RUN: clang-cc -fsyntax-only -code-completion-at=%s:10:8 %s -o - | FileCheck -check-prefix=CC1 %s
   // CHECK-CC1: allocator<<#typename T#>>
-  // CHECK-CC1: vector<<#typename T#>{#, <#typename Alloc#>#}>
+  // CHECK-CC1-NEXT: vector<<#typename T#>{#, <#typename Alloc#>#}>