aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaConcept.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaConcept.cpp')
-rw-r--r--clang/lib/Sema/SemaConcept.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index a1163e9..f04cc45 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -385,6 +385,28 @@ public:
return inherited::TraverseStmt(E->getReplacement());
}
+ bool TraverseTemplateName(TemplateName Template) {
+ if (auto *TTP = dyn_cast_if_present<TemplateTemplateParmDecl>(
+ Template.getAsTemplateDecl());
+ TTP && TTP->getDepth() < TemplateArgs.getNumLevels()) {
+ if (!TemplateArgs.hasTemplateArgument(TTP->getDepth(),
+ TTP->getPosition()))
+ return true;
+
+ TemplateArgument Arg = TemplateArgs(TTP->getDepth(), TTP->getPosition());
+ if (TTP->isParameterPack() && SemaRef.ArgPackSubstIndex) {
+ assert(Arg.getKind() == TemplateArgument::Pack &&
+ "Missing argument pack");
+ Arg = SemaRef.getPackSubstitutedTemplateArgument(Arg);
+ }
+ assert(!Arg.getAsTemplate().isNull() &&
+ "Null template template argument");
+ UsedTemplateArgs.push_back(
+ SemaRef.Context.getCanonicalTemplateArgument(Arg));
+ }
+ return inherited::TraverseTemplateName(Template);
+ }
+
void VisitConstraint(const NormalizedConstraintWithParamMapping &Constraint) {
if (!Constraint.hasParameterMapping()) {
for (const auto &List : TemplateArgs)
@@ -2678,8 +2700,9 @@ FormulaType SubsumptionChecker::Normalize(const NormalizedConstraint &NC) {
});
if (Compound.getCompoundKind() == FormulaType::Kind) {
+ unsigned SizeLeft = Left.size();
Res = std::move(Left);
- Res.reserve(Left.size() + Right.size());
+ Res.reserve(SizeLeft + Right.size());
std::for_each(std::make_move_iterator(Right.begin()),
std::make_move_iterator(Right.end()), Add);
return Res;