diff options
author | Nikola Smiljanic <popizdeh@gmail.com> | 2014-09-26 00:28:20 +0000 |
---|---|---|
committer | Nikola Smiljanic <popizdeh@gmail.com> | 2014-09-26 00:28:20 +0000 |
commit | 67860249e0649f734f4b481c40d98fa136380859 (patch) | |
tree | 5fa0e7e4c76daffe2f02b79ee407953247a23330 /clang/lib/Sema/SemaTemplate.cpp | |
parent | e89258041578d534eb4fc8641d48822f066c24f8 (diff) | |
download | bcm5719-llvm-67860249e0649f734f4b481c40d98fa136380859.tar.gz bcm5719-llvm-67860249e0649f734f4b481c40d98fa136380859.zip |
-ms-extensions: Implement __super scope specifier (PR13236).
We build a NestedNameSpecifier that records the CXXRecordDecl in which
__super appeared. Name lookup is performed in all base classes of the
recorded CXXRecordDecl. Use of __super is allowed only inside class and
member function scope.
llvm-svn: 218484
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 3c37a3e2d06..b47ce684446 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -4127,6 +4127,7 @@ bool UnnamedLocalNoLinkageFinder::VisitNestedNameSpecifier( case NestedNameSpecifier::Namespace: case NestedNameSpecifier::NamespaceAlias: case NestedNameSpecifier::Global: + case NestedNameSpecifier::Super: return false; case NestedNameSpecifier::TypeSpec: @@ -7900,7 +7901,11 @@ Sema::CheckTypenameType(ElaboratedTypeKeyword Keyword, DeclarationName Name(&II); LookupResult Result(*this, Name, IILoc, LookupOrdinaryName); - LookupQualifiedName(Result, Ctx); + NestedNameSpecifier *NNS = SS.getScopeRep(); + if (NNS->getKind() == NestedNameSpecifier::Super) + LookupInSuper(Result, NNS->getAsRecordDecl()); + else + LookupQualifiedName(Result, Ctx); unsigned DiagID = 0; Decl *Referenced = nullptr; switch (Result.getResultKind()) { |