[PATCH] D110216: [clang] retain type sugar in auto / template argument deduction

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 4 12:21:28 PDT 2021


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

In D110216#3040748 <https://reviews.llvm.org/D110216#3040748>, @craig.topper wrote:

> Looks like this fixes PR51282.

Okay, interesting. This could be just papering over the bug.
Do you still lose this alignment if it goes through a template argument?
If you do, this looks like a canonicalization bug.



================
Comment at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:1032
     if (const auto *S = dyn_cast<DeducedType>(&Node)) {
-      EffectiveType = S->getDeducedType().getTypePtrOrNull();
-      if (!EffectiveType)
-        return false;
+      QualType T = S->getDeducedType();
+      return !T.isNull() ? matchesSpecialized(*T, Finder, Builder) : false;
----------------
craig.topper wrote:
> gcc 8.4.1 doesn't like `T` being the same name as a template parameter for this class.
Oh wow, didn't even realize, thanks!!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110216



More information about the cfe-commits mailing list