[Bug c++/87786] New: Failed to mangle sizeof...(ArgPack) with template-alias captured arguments
xecycle at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Oct 29 08:42:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87786
Bug ID: 87786
Summary: Failed to mangle sizeof...(ArgPack) with
template-alias captured arguments
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: xecycle at gmail dot com
Target Milestone: ---
Reproducing code (at https://godbolt.org/z/dbqZu7):
```
#include <cstddef>
double g(int);
template <size_t X>
struct M {};
template <class... T>
using make_M = M<sizeof...(T)>;
template <class... T>
auto f(T&&... x)
-> make_M<decltype(g(x))...>
{
using _noop = int[];
(void)_noop { ((void)x, 0)... };
return {};
}
auto m = f(12, 34);
```
It fails to compile with versions >= 7. At first it looks like a regression;
but it probably is not. It's more like an incomplete attempt (in 7.x) to fix a
previous mangling bug. 6.x and earlier does compile, but the mangled output
used "sz" instead of "sP"; gcc/cp/mangle.c on trunk actually contains a line
`write_string ("sP");`, but seems it did not reach there in this example.
More information about the Gcc-bugs
mailing list