erichkeane added a comment.

In D145892#4191220 <https://reviews.llvm.org/D145892#4191220>, @HerrCai0907 
wrote:

> I cannot find an example that throw `error: expression contains unexpanded 
> parameter pack 'T'` in fold expression because code like ` (foo<T>(10 + 
> (static_cast<U>(1))) + ...);` can be unpack both `T` and `U` in same `...` 
> operator
>
> But this code can be diagnosed correctly
>
>   template <typename... U> struct A {
>     template <typename... T> void foo(T &&...Params) {
>       (foo<T>(1 + (static_cast<U>(1))) + ...); // ok
>   
>       // error: expression contains unexpanded parameter pack 'T'
>       foo<T>((... + static_cast<U>(1)));
>   
>       (foo<T>((... + static_cast<U>(1))) + ...); // ok
>     }
>   };
>
> Should I add this case into test?

I spent some time on this and I can't come up with any counter examples either. 
 Please add this to the test, add a release note, then this LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145892

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

Reply via email to