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

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 3 08:07:50 PDT 2021


v.g.vassilev added a comment.

In D110216#3035041 <https://reviews.llvm.org/D110216#3035041>, @mizvekov wrote:

> In D110216#3032626 <https://reviews.llvm.org/D110216#3032626>, @v.g.vassilev wrote:
>
>> Thanks for working on this!How hard would it be to support:
>>
>>   using size_t = __SIZE_TYPE__;
>>   template<typename T> struct Id { typedef T type; };
>>   int main() {
>>     struct S {} s;
>>     Id<size_t>::type f = s; // just 'unsigned long', 'size_t' sugar has been lost
>>   }
>
> Actually supporting that is in my radar :)

Over the years we had some interest from people but never actually got implemented. Here <https://lists.llvm.org/pipermail/llvm-dev/2020-March/140054.html> were some ideas @rsmith and I discussed over the years. If that is helpful, let me know if I should dig a bit more into private email exchange.


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