summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorNikola Smiljanic <popizdeh@gmail.com>2014-09-26 00:28:20 +0000
committerNikola Smiljanic <popizdeh@gmail.com>2014-09-26 00:28:20 +0000
commit7159053ff39fc804d43dde24ce0682394fd2600d (patch)
tree4ce17326e7e819ad73d2837d7d32a20ff53f7025 /lib/Sema/SemaTemplate.cpp
parent91771659dc757aa861477ec32404a53a4af842b3 (diff)
-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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 3c37a3e2d0..b47ce68444 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/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()) {