From 59cab5564fc252fd744a57e2ef393a2e35c12754 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 16 Aug 2010 23:05:20 +0000 Subject: Implement support for cached code completions for nested-name-specifiers. Also includes fixes to the generation of nested-name-specifier result in the non-cached case; we were producing lame results for namespaces and namespace aliases, which (1) didn't always have nested-name-specifiers when we want them, and (2) did not have the necessary "::" as part of the completion. llvm-svn: 111203 --- clang/lib/Sema/SemaCodeComplete.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'clang/lib/Sema/SemaCodeComplete.cpp') diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 332f8c80293..d61c4301413 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -426,6 +426,12 @@ bool ResultBuilder::isInterestingDecl(NamedDecl *ND, if (isa(ND)) return false; + if (Filter == &ResultBuilder::IsNestedNameSpecifier || + ((isa(ND) || isa(ND)) && + Filter != &ResultBuilder::IsNamespace && + Filter != &ResultBuilder::IsNamespaceOrAlias)) + AsNestedNameSpecifier = true; + // Filter out any unwanted results. if (Filter && !(this->*Filter)(ND)) { // Check whether it is interesting as a nested-name-specifier. @@ -439,11 +445,7 @@ bool ResultBuilder::isInterestingDecl(NamedDecl *ND, } return false; - } - - if (Filter == &ResultBuilder::IsNestedNameSpecifier) - AsNestedNameSpecifier = true; - + } // ... then it must be interesting! return true; } -- cgit v1.2.3