diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-20 00:20:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-01-20 00:20:39 +0000 |
commit | 8ae50eb5f49e12129ad4e935ae8985a7e5c1b4be (patch) | |
tree | fd54f8a76156f0f9d0d9a5ba9b4202b11630d7f8 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | d562f4cb87e789d165c70de9030c9dcd1187955d (diff) |
Finish implementation of C++ DR1310 (http://wg21.link/cwg1310).
Diagnose the case when a dependent template name instantiates to an
injected-class-name outside a nested-name-specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 9f744a1dc1..aff19ec597 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -806,7 +806,8 @@ namespace { TransformTemplateName(CXXScopeSpec &SS, TemplateName Name, SourceLocation NameLoc, QualType ObjectType = QualType(), - NamedDecl *FirstQualifierInScope = nullptr); + NamedDecl *FirstQualifierInScope = nullptr, + bool AllowInjectedClassName = false); const LoopHintAttr *TransformLoopHintAttr(const LoopHintAttr *LH); @@ -1040,11 +1041,10 @@ TemplateInstantiator::RebuildElaboratedType(SourceLocation KeywordLoc, T); } -TemplateName TemplateInstantiator::TransformTemplateName(CXXScopeSpec &SS, - TemplateName Name, - SourceLocation NameLoc, - QualType ObjectType, - NamedDecl *FirstQualifierInScope) { +TemplateName TemplateInstantiator::TransformTemplateName( + CXXScopeSpec &SS, TemplateName Name, SourceLocation NameLoc, + QualType ObjectType, NamedDecl *FirstQualifierInScope, + bool AllowInjectedClassName) { if (TemplateTemplateParmDecl *TTP = dyn_cast_or_null<TemplateTemplateParmDecl>(Name.getAsTemplateDecl())) { if (TTP->getDepth() < TemplateArgs.getNumLevels()) { @@ -1095,9 +1095,10 @@ TemplateName TemplateInstantiator::TransformTemplateName(CXXScopeSpec &SS, Arg = getPackSubstitutedTemplateArgument(getSema(), Arg); return Arg.getAsTemplate(); } - - return inherited::TransformTemplateName(SS, Name, NameLoc, ObjectType, - FirstQualifierInScope); + + return inherited::TransformTemplateName(SS, Name, NameLoc, ObjectType, + FirstQualifierInScope, + AllowInjectedClassName); } ExprResult |