diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-11 16:18:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-11 16:18:54 +0000 |
commit | e29ffaae9b2f474b1cf559704c66de8498177559 (patch) | |
tree | 62debd875a65cb8a79c42478cefc2a58d704acfd | |
parent | 8d04258483be6583f0865464234d014807a3e1cc (diff) |
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
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 5 | ||||
-rw-r--r-- | test/CodeCompletion/templates.cpp | 6 |
2 files changed, 8 insertions, 3 deletions
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<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. 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<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#>#}> |