diff options
author | Nikola Smiljanic <popizdeh@gmail.com> | 2014-12-01 23:15:01 +0000 |
---|---|---|
committer | Nikola Smiljanic <popizdeh@gmail.com> | 2014-12-01 23:15:01 +0000 |
commit | e03d3c217f3761218b33513bf7a4440d54d29748 (patch) | |
tree | 5c193ab7a17cf11b02d9d36f1765765bfbe6fa4d /lib/Sema/SemaLookup.cpp | |
parent | 1c629f3cff6e0b9db21ff171826401f695b027c1 (diff) |
Perform correct lookup when '__super' is used in class with dependent base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 8b0ea324e5..e1a9a554b3 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1762,6 +1762,31 @@ bool Sema::LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, return true; } +/// \brief Performs qualified name lookup or special type of lookup for +/// "__super::" scope specifier. +/// +/// This routine is a convenience overload meant to be called from contexts +/// that need to perform a qualified name lookup with an optional C++ scope +/// specifier that might require special kind of lookup. +/// +/// \param R captures both the lookup criteria and any lookup results found. +/// +/// \param LookupCtx The context in which qualified name lookup will +/// search. +/// +/// \param SS An optional C++ scope-specifier. +/// +/// \returns true if lookup succeeded, false if it failed. +bool Sema::LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, + CXXScopeSpec &SS) { + auto *NNS = SS.getScopeRep(); + if (NNS && NNS->getKind() == NestedNameSpecifier::Super) + return LookupInSuper(R, NNS->getAsRecordDecl()); + else + + return LookupQualifiedName(R, LookupCtx); +} + /// @brief Performs name lookup for a name that was parsed in the /// source code, and may contain a C++ scope specifier. /// |