diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-16 23:05:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-16 23:05:20 +0000 |
commit | a5fb7c3b56c3698e19a7c1e97d41150de33cf6c9 (patch) | |
tree | ed5d2161d769c878c2564b48f9da0176af0b5f0d /lib/Sema/SemaCodeComplete.cpp | |
parent | 57dae1a312e3f7591e957adc89776ef4bca6a097 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 332f8c8029..d61c430141 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -426,6 +426,12 @@ bool ResultBuilder::isInterestingDecl(NamedDecl *ND, if (isa<CXXConstructorDecl>(ND)) return false; + if (Filter == &ResultBuilder::IsNestedNameSpecifier || + ((isa<NamespaceDecl>(ND) || isa<NamespaceAliasDecl>(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; } |