[clang] f3e0298 - [NFC][Clang] Remove dead code
Yuanfang Chen via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 26 18:33:31 PDT 2022
Author: Yuanfang Chen
Date: 2022-09-26T18:32:52-07:00
New Revision: f3e02989e6e5d6fa90d5ac1ea21c592197a0ae7d
URL: https://github.com/llvm/llvm-project/commit/f3e02989e6e5d6fa90d5ac1ea21c592197a0ae7d
DIFF: https://github.com/llvm/llvm-project/commit/f3e02989e6e5d6fa90d5ac1ea21c592197a0ae7d.diff
LOG: [NFC][Clang] Remove dead code
And correct a few typos.
Added:
Modified:
clang/include/clang/AST/DeclTemplate.h
clang/lib/AST/ASTContext.cpp
Removed:
################################################################################
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<const Expr *> &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())
More information about the cfe-commits
mailing list