diff options
author | Reid Kleckner <rnk@google.com> | 2019-12-22 11:37:54 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-12-22 11:40:07 -0800 |
commit | 79cc9e9b304a90598e8def4c8b5354d1f99186eb (patch) | |
tree | 167eb223a5d3e2d9995f4fbfd856ea18b451abaf /clang/lib/Sema/SemaTemplate.cpp | |
parent | fb0ccff6e56bde6c42b2ff941861564e24a7a805 (diff) | |
download | bcm5719-llvm-79cc9e9b304a90598e8def4c8b5354d1f99186eb.tar.gz bcm5719-llvm-79cc9e9b304a90598e8def4c8b5354d1f99186eb.zip |
Revert "[Concepts] Constrained partial specializations and function overloads."
This reverts commit d3f5769d5e93b30d4a8b4696381d5e4a304992fa.
Causes crashes on Chromium. Have reproducer, will reduce and send along.
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--[-rwxr-xr-x] | clang/lib/Sema/SemaTemplate.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index ade8a5a6ac1..699895568b7 100755..100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1120,11 +1120,11 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, // Check that we have valid decl-specifiers specified. auto CheckValidDeclSpecifiers = [this, &D] { // C++ [temp.param] - // p1 + // p1 // template-parameter: // ... // parameter-declaration - // p2 + // p2 // ... A storage class shall not be specified in a template-parameter // declaration. // [dcl.typedef]p1: @@ -3900,9 +3900,7 @@ DeclResult Sema::ActOnVarTemplateSpecialization( } if (isSameAsPrimaryTemplate(VarTemplate->getTemplateParameters(), - Converted) && - (!Context.getLangOpts().ConceptsTS || - !TemplateParams->hasAssociatedConstraints())) { + Converted)) { // C++ [temp.class.spec]p9b3: // // -- The argument list of the specialization shall not be identical @@ -3921,8 +3919,8 @@ DeclResult Sema::ActOnVarTemplateSpecialization( VarTemplateSpecializationDecl *PrevDecl = nullptr; if (IsPartialSpecialization) - PrevDecl = VarTemplate->findPartialSpecialization(Converted, TemplateParams, - InsertPos); + // FIXME: Template parameter list matters too + PrevDecl = VarTemplate->findPartialSpecialization(Converted, InsertPos); else PrevDecl = VarTemplate->findSpecialization(Converted, InsertPos); @@ -5275,16 +5273,12 @@ bool Sema::CheckTemplateArgumentList( bool PackExpansionIntoNonPack = NewArgs[ArgIdx].getArgument().isPackExpansion() && (!(*Param)->isTemplateParameterPack() || getExpandedPackSize(*Param)); - if (PackExpansionIntoNonPack && (isa<TypeAliasTemplateDecl>(Template) || - isa<ConceptDecl>(Template))) { + if (PackExpansionIntoNonPack && isa<TypeAliasTemplateDecl>(Template)) { // Core issue 1430: we have a pack expansion as an argument to an // alias template, and it's not part of a parameter pack. This // can't be canonicalized, so reject it now. - // As for concepts - we cannot normalize constraints where this - // situation exists. Diag(NewArgs[ArgIdx].getLocation(), - diag::err_template_expansion_into_fixed_list) - << (isa<ConceptDecl>(Template) ? 1 : 0) + diag::err_alias_template_expansion_into_fixed_list) << NewArgs[ArgIdx].getSourceRange(); Diag((*Param)->getLocation(), diag::note_template_param_here); return true; @@ -7118,7 +7112,6 @@ static bool MatchTemplateParameterKind(Sema &S, NamedDecl *New, NamedDecl *Old, bool Complain, Sema::TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc) { - // TODO: Concepts: Check constrained-parameter constraints here. // Check the actual kind (type, non-type, template). if (Old->getKind() != New->getKind()) { if (Complain) { @@ -7820,9 +7813,8 @@ DeclResult Sema::ActOnClassTemplateSpecialization( ClassTemplateSpecializationDecl *PrevDecl = nullptr; if (isPartialSpecialization) - PrevDecl = ClassTemplate->findPartialSpecialization(Converted, - TemplateParams, - InsertPos); + // FIXME: Template parameter list matters, too + PrevDecl = ClassTemplate->findPartialSpecialization(Converted, InsertPos); else PrevDecl = ClassTemplate->findSpecialization(Converted, InsertPos); @@ -7846,9 +7838,7 @@ DeclResult Sema::ActOnClassTemplateSpecialization( Converted); if (Context.hasSameType(CanonType, - ClassTemplate->getInjectedClassNameSpecialization()) && - (!Context.getLangOpts().ConceptsTS || - !TemplateParams->hasAssociatedConstraints())) { + ClassTemplate->getInjectedClassNameSpecialization())) { // C++ [temp.class.spec]p9b3: // // -- The argument list of the specialization shall not be identical |