[PATCH] D110216: [clang] retain type sugar in auto / template argument deduction
Matheus Izvekov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 30 15:59:55 PDT 2021
mizvekov added inline comments.
================
Comment at: clang/lib/Sema/SemaTemplateDeduction.cpp:1643
- return Param == Arg? Sema::TDK_Success : Sema::TDK_NonDeducedMismatch;
+ return ParDesug == ArgDesug ? Sema::TDK_Success
+ : Sema::TDK_NonDeducedMismatch;
----------------
rsmith wrote:
> This looks wrong to me: we should be comparing the types, not how they're written. `Context.hasSameType(Param, Arg)` (or `Context.hasSameUnqualifiedType(Param, Arg)` in the `TDF_IgnoreQualifiers` case) would be appropriate here.
You are right, but the reason we don't get into any troubles here is because this is dead code anyway, the non-dependent case will always be handled above :)
Although perhaps, I wonder if we should dig down into non-dependent types anyway, in case the types are too complex and it's not immediately obvious what does not match, we could perhaps improve the diagnostic?
I will experiment a little bit with this idea.
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