summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/Sema.h3
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp7
-rw-r--r--clang/lib/Sema/TreeTransform.h6
3 files changed, 10 insertions, 6 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h
index 6e74f9277a1..2d3f9fc8cb2 100644
--- a/clang/lib/Sema/Sema.h
+++ b/clang/lib/Sema/Sema.h
@@ -2293,7 +2293,8 @@ public:
virtual TemplateTy ActOnDependentTemplateName(SourceLocation TemplateKWLoc,
const CXXScopeSpec &SS,
UnqualifiedId &Name,
- TypeTy *ObjectType);
+ TypeTy *ObjectType,
+ bool EnteringContext);
bool CheckClassTemplatePartialSpecializationArgs(
TemplateParameterList *TemplateParams,
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 8d77b1ff9b8..f0133438941 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -1381,10 +1381,11 @@ Sema::TemplateTy
Sema::ActOnDependentTemplateName(SourceLocation TemplateKWLoc,
const CXXScopeSpec &SS,
UnqualifiedId &Name,
- TypeTy *ObjectType) {
+ TypeTy *ObjectType,
+ bool EnteringContext) {
if ((ObjectType &&
computeDeclContext(QualType::getFromOpaquePtr(ObjectType))) ||
- (SS.isSet() && computeDeclContext(SS, false))) {
+ (SS.isSet() && computeDeclContext(SS, EnteringContext))) {
// C++0x [temp.names]p5:
// If a name prefixed by the keyword template is not the name of
// a template, the program is ill-formed. [Note: the keyword
@@ -1403,7 +1404,7 @@ Sema::ActOnDependentTemplateName(SourceLocation TemplateKWLoc,
// rules, even in C++03 mode, retroactively applying the DR.
TemplateTy Template;
TemplateNameKind TNK = isTemplateName(0, SS, Name, ObjectType,
- false, Template);
+ EnteringContext, Template);
if (TNK == TNK_Non_template) {
Diag(Name.getSourceRange().getBegin(),
diag::err_template_kw_refers_to_non_template)
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 579937ead76..5018b1544e4 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -5349,7 +5349,8 @@ TreeTransform<Derived>::RebuildTemplateName(NestedNameSpecifier *Qualifier,
/*FIXME:*/getDerived().getBaseLocation(),
SS,
Name,
- ObjectType.getAsOpaquePtr())
+ ObjectType.getAsOpaquePtr(),
+ /*EnteringContext=*/false)
.template getAsVal<TemplateName>();
}
@@ -5369,7 +5370,8 @@ TreeTransform<Derived>::RebuildTemplateName(NestedNameSpecifier *Qualifier,
/*FIXME:*/getDerived().getBaseLocation(),
SS,
Name,
- ObjectType.getAsOpaquePtr())
+ ObjectType.getAsOpaquePtr(),
+ /*EnteringContext=*/false)
.template getAsVal<TemplateName>();
}
OpenPOWER on IntegriCloud