https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100709
Bug ID: 100709
Summary: Use of a function parameter pack in an expression
expected to be constexpr in a deduction guide produces
an unclear diagnostic.
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: brycelelbach at gmail dot com
Target Milestone: ---
Use of a function parameter pack in an expression expected to be `constexpr` in
a deduction guide leads to an unclear diagnostic.
Such code should be ill-formed, because a function parameter pack is not
`constexpr` itself, so it can't be used in a `constexpr` context.
Use a function parameter pack in an expression expected to be `constexpr` in
other contexts, like in a function body, does produce a good diagnostic, which
points to the problematic line of code and names the problematic function
parameter pack (`i`) - or at least, names the expansion of it to its elements.
I found this diagnostic sufficient to understand the issue.
You can see both cases here:
https://godbolt.org/z/4joWjejMn