diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index dbea107f368fb..78e99f8335b98 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -1226,7 +1226,7 @@ class TemplateTypeParmDecl final : public TypeDecl, /// type constraint. bool TypeConstraintInitialized : 1; - /// Whether this non-type template parameter is an "expanded" + /// Whether this type template parameter is an "expanded" /// parameter pack, meaning that its type is a pack expansion and we /// already know the set of types that expansion expands to. bool ExpandedParameterPack : 1; @@ -1391,7 +1391,7 @@ class TemplateTypeParmDecl final : public TypeDecl, /// \brief Get the associated-constraints of this template parameter. /// This will either be the immediately-introduced constraint or empty. /// - /// Use this instead of getConstraintExpression for concepts APIs that + /// Use this instead of getTypeConstraint for concepts APIs that /// accept an ArrayRef of constraint expressions. void getAssociatedConstraints(llvm::SmallVectorImpl &AC) const { if (HasTypeConstraint) diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 1a15292c12d3e..99ab66d4f3640 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -800,12 +800,6 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( Expr *NewIDC = canonicalizeImmediatelyDeclaredConstraint( *this, TC->getImmediatelyDeclaredConstraint(), ParamAsArgument); - TemplateArgumentListInfo CanonArgsAsWritten; - if (auto *Args = TC->getTemplateArgsAsWritten()) - for (const auto &ArgLoc : Args->arguments()) - CanonArgsAsWritten.addArgument( - TemplateArgumentLoc(ArgLoc.getArgument(), - TemplateArgumentLocInfo())); NewTTP->setTypeConstraint( NestedNameSpecifierLoc(), DeclarationNameInfo(TC->getNamedConcept()->getDeclName(), @@ -5166,7 +5160,7 @@ TemplateArgument ASTContext::getInjectedTemplateArg(NamedDecl *Param) { if (T->isRecordType()) T.addConst(); Expr *E = new (*this) DeclRefExpr( - *this, NTTP, /*enclosing*/ false, T, + *this, NTTP, /*RefersToEnclosingVariableOrCapture*/ false, T, Expr::getValueKindForType(NTTP->getType()), NTTP->getLocation()); if (NTTP->isParameterPack())