From: Douglas Gregor Date: Fri, 11 Dec 2009 16:18:54 +0000 (+0000) Subject: Class template (partial) specializations should not show up in code completion results X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e29ffaae9b2f474b1cf559704c66de8498177559;p=clang Class template (partial) specializations should not show up in code completion results git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91125 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 73e0ab0fad..63c8bdcc6c 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -363,6 +363,11 @@ void ResultBuilder::MaybeAddResult(Result R, DeclContext *CurContext) { if (isa(CanonDecl) || (IDNS & (Decl::IDNS_OrdinaryFriend | Decl::IDNS_TagFriend))) return; + + // Class template (partial) specializations are never added as results + if (isa(CanonDecl) || + isa(CanonDecl)) + return; if (const IdentifierInfo *Id = R.Declaration->getIdentifier()) { // __va_list_tag is a freak of nature. Find it and skip it. diff --git a/test/CodeCompletion/templates.cpp b/test/CodeCompletion/templates.cpp index d35e0bb8dc..5a0bdb19f1 100644 --- a/test/CodeCompletion/templates.cpp +++ b/test/CodeCompletion/templates.cpp @@ -2,15 +2,15 @@ namespace std { template class allocator; - template > - class vector; + template > class vector; + template class vector; } 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#>#}>