[PATCH] D135088: [Clang] make canonical AutoType constraints-free

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 18:12:23 PDT 2022


ychen marked an inline comment as done.
ychen added a comment.

@mizvekov Thanks for the review!



================
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,
----------------
mizvekov wrote:
> 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.
Yep. That's better.


================
Comment at: clang/lib/AST/ASTContext.cpp:6335-6338
+           TX->hasPlaceholderTypeConstraint() ==
+               TY->hasPlaceholderTypeConstraint() &&
+           isSameConstraintExpr(TX->getPlaceholderTypeConstraint(),
+                                TY->getPlaceholderTypeConstraint());
----------------
mizvekov wrote:
> `isSameConstraintExpr` already handles that.
Ack.


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