ilya-biryukov added a comment.

In D72498#1814366 <https://reviews.llvm.org/D72498#1814366>, @sammccall wrote:

> @ilya-biryukov @kadircet what do you think about unwrapping decltype only 
> when it's a return value (optional: of a function whose leading return type 
> is auto) to narrowly catch this idiom?


If we feel it's useful in the function return type, it's probably also useful 
in other template contexts:
E.g.

  template <class T>
  struct X {
    typedef decltype(T() + T()) add_result_type;
  };
  
  X<int>::^add_result_type y;

And I don't think it's used in practice in more contexts.

Moreover, I believe usages in function returns will become more rare as 
projects move to C++14 and beyond (`auto` return type gives the same results in 
most interesting cases without code duplication).

Therefore, I'd not special-case for function return types.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72498



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to