[cfe-commits] r91125 - in /cfe/trunk: lib/Sema/SemaCodeComplete.cpp test/CodeCompletion/templates.cpp
Douglas Gregor
dgregor at apple.com
Fri Dec 11 08:18:54 PST 2009
Author: dgregor
Date: Fri Dec 11 10:18:54 2009
New Revision: 91125
URL: http://llvm.org/viewvc/llvm-project?rev=91125&view=rev
Log:
Class template (partial) specializations should not show up in code completion results
Modified:
cfe/trunk/lib/Sema/SemaCodeComplete.cpp
cfe/trunk/test/CodeCompletion/templates.cpp
Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=91125&r1=91124&r2=91125&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Fri Dec 11 10:18:54 2009
@@ -363,6 +363,11 @@
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.
Modified: cfe/trunk/test/CodeCompletion/templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeCompletion/templates.cpp?rev=91125&r1=91124&r2=91125&view=diff
==============================================================================
--- cfe/trunk/test/CodeCompletion/templates.cpp (original)
+++ cfe/trunk/test/CodeCompletion/templates.cpp Fri Dec 11 10:18:54 2009
@@ -2,15 +2,15 @@
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#>#}>
More information about the cfe-commits
mailing list