[PATCH] D135088: [Clang] make canonical AutoType constraints-free
Matheus Izvekov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 3 18:03:10 PDT 2022
mizvekov accepted this revision.
mizvekov added inline comments.
================
Comment at: clang/lib/AST/ASTContext.cpp:5768-5769
if (!IsCanon) {
if (DeducedType.isNull()) {
- SmallVector<TemplateArgument, 4> CanonArgs;
- bool AnyNonCanonArgs =
- ::getCanonicalTemplateArguments(*this, TypeConstraintArgs, CanonArgs);
- if (AnyNonCanonArgs) {
+ if (TypeConstraintConcept) {
Canon = getAutoTypeInternal(QualType(), Keyword, IsDependent, IsPack,
----------------
Last minor nit, but I think this looks more readable if you invert the isNull check and do the `TypeConstraintConcept` on the else of that, less nesting.
================
Comment at: clang/lib/AST/ASTContext.cpp:6335-6338
+ TX->hasPlaceholderTypeConstraint() ==
+ TY->hasPlaceholderTypeConstraint() &&
+ isSameConstraintExpr(TX->getPlaceholderTypeConstraint(),
+ TY->getPlaceholderTypeConstraint());
----------------
`isSameConstraintExpr` already handles that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135088/new/
https://reviews.llvm.org/D135088
More information about the cfe-commits
mailing list