================
@@ -935,6 +935,11 @@ class PackDeductionScope {
S.collectUnexpandedParameterPacks(Pattern, Unexpanded);
for (unsigned I = 0, N = Unexpanded.size(); I != N; ++I) {
unsigned Depth, Index;
+
+ // Function parameter packs cannot be deduced.
+ if (isa_and_nonnull<ParmVarDecl>(
+ dyn_cast<NamedDecl *>(Unexpanded[I].first)))
+ continue;
----------------
zwuis wrote:
> ... This is confusing, for example
>
> ```cpp
> void f(auto... param) {
> auto g = [](decltype(param)... pp) {};
> g(param...);
> }
> ```
>
> in such context, `pp` are indeed deduced from (though substituted) `param...`.
There is no deduction triggered by `g(param...)`. `pp` is expanded at the same
time when `decltype(param)...` is expanded. We can observe exact parameter
types of the lambda if we remove `g(param...)` and instantiate `f`.
https://github.com/llvm/llvm-project/pull/215235
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits