summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorSaar Raz <saar@raz.email>2020-01-22 04:21:09 +0200
committerSaar Raz <saar@raz.email>2020-01-24 02:28:32 +0200
commit29f14c1df25992db8c908e441c69e1fd4d4e4010 (patch)
treec4f05cf40010d90203cf59ed256ae9fecf1a4c94 /clang/lib/Sema
parenta9b2cf6c625ab15e3cef00350c855e7cd319cf83 (diff)
downloadbcm5719-llvm-29f14c1df25992db8c908e441c69e1fd4d4e4010.tar.gz
bcm5719-llvm-29f14c1df25992db8c908e441c69e1fd4d4e4010.zip
[Concepts] Implement P1616R1 - Using unconstrained template template parameters with constrained templates
Summary: Allow unconstrained template template parameters to accept constrainted templates as arguments. Reviewers: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73155 (cherry picked from commit d42d5eb8ea77b3a3a502a60ba3f053fb81a897f3)
Diffstat (limited to 'clang/lib/Sema')
-rwxr-xr-xclang/lib/Sema/SemaTemplate.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 44b58e1a80a..c05a08f59ac 100755
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -7164,6 +7164,11 @@ bool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param,
// [temp.constr.order].
SmallVector<const Expr *, 3> ParamsAC, TemplateAC;
Params->getAssociatedConstraints(ParamsAC);
+ // C++2a[temp.arg.template]p3
+ // [...] In this comparison, if P is unconstrained, the constraints on A
+ // are not considered.
+ if (ParamsAC.empty())
+ return false;
Template->getAssociatedConstraints(TemplateAC);
bool IsParamAtLeastAsConstrained;
if (IsAtLeastAsConstrained(Param, ParamsAC, Template, TemplateAC,
OpenPOWER on IntegriCloud