[PATCH] D111283: [clang] template / auto deduction deduces common sugar

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 1 19:30:48 PDT 2022


mizvekov added inline comments.


================
Comment at: clang/include/clang/AST/ASTContext.h:2819-2823
+  // For two canonically equal types, return a type which has
+  // the common sugar between them. If Unqualified is true,
+  // both types need only be the same unqualified type.
+  // The result will drop the qualifiers which do not occur
+  // in both types.
----------------
ChuanqiXu wrote:
> For this comment, I want to know what if `X`and `Y` is not equal. Is there an assertion failure or special type returned?
Assertion failure, the function is supposed to handle only the case where `hasSame[Unqualified]Type(X, Y) == true`.

It will always return a type `R` for which `hasSame[Unqualified]Type(R, Y) == true` also holds, so there are no special return values.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111283/new/

https://reviews.llvm.org/D111283



More information about the cfe-commits mailing list