diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-06-15 21:40:54 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-06-15 21:40:54 +0000 |
commit | 8a7a4cfa4397523f689916b92c0be894f73573de (patch) | |
tree | af5446caddf2b5dd6a1fd6ac117a560139f8cf59 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 2ba991ff2c0d7c785a9eae088e18f7e3ce1e4149 (diff) | |
download | bcm5719-llvm-8a7a4cfa4397523f689916b92c0be894f73573de.tar.gz bcm5719-llvm-8a7a4cfa4397523f689916b92c0be894f73573de.zip |
[Completion] Code complete the members for a dependent type after a '::'
This commit is a follow up to r302797 which added support for dependent
completions after the '.' and '->' operators. This commit adds support for
dependent completions after the '::' operator.
Differential Revision: https://reviews.llvm.org/D34173
llvm-svn: 305511
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index b9349dc06bf..83c3bd27596 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -4542,8 +4542,10 @@ void Sema::CodeCompleteQualifiedId(Scope *S, CXXScopeSpec &SS, bool EnteringContext) { if (!SS.getScopeRep() || !CodeCompleter) return; - - DeclContext *Ctx = computeDeclContext(SS, EnteringContext); + + // Always pretend to enter a context to ensure that a dependent type + // resolves to a dependent record. + DeclContext *Ctx = computeDeclContext(SS, /*EnteringContext=*/true); if (!Ctx) return; @@ -4573,7 +4575,9 @@ void Sema::CodeCompleteQualifiedId(Scope *S, CXXScopeSpec &SS, Results.ExitScope(); CodeCompletionDeclConsumer Consumer(Results, CurContext); - LookupVisibleDecls(Ctx, LookupOrdinaryName, Consumer); + LookupVisibleDecls(Ctx, LookupOrdinaryName, Consumer, + /*IncludeGlobalScope=*/true, + /*IncludeDependentBases=*/true); HandleCodeCompleteResults(this, CodeCompleter, Results.getCompletionContext(), |