[PATCH] D76038: PR45000: Use Sema::SetParamDefaultArgument in TransformLambdaExpr

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 05:54:50 PDT 2020


aaronpuchert added a comment.

Let's have a look at an example. Do we allow this?

  template<typename T, int... args>
  int x = [](T = T()){ return 0; }(args...);
  
  template int x<int>; // Uses default argument int() = 0.
  
  struct S { S(int); };
  template int x<S, 0>; // Default argument not well-formed, but not needed.

Currently we don't, and neither does GCC.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76038





More information about the cfe-commits mailing list