[Bug c++/63849] New: [4.9/5.0 Regression] ICE on variadic alias template with wrappers
reagentoo at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Nov 13 10:33:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63849
Bug ID: 63849
Summary: [4.9/5.0 Regression] ICE on variadic alias template
with wrappers
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reagentoo at gmail dot com
The following invalid (or perhaps invalid, I think) code snippet triggers an
ICE in GCC 4.9.2 and 5.0.0 (20141111):
================================================
template <class _T, class...>
using First = _T; // we should not use this
// alias with only
// one pack parameter (?)
template <template <class...> class _Successor,
int,
class... _Xs>
struct Overlay
{
using O = _Successor<_Xs...>;
};
template <class... _Pack>
struct List
{
template <int _s>
using O = typename Overlay<List, _s, _Pack...>::O;
template <template <class...> class _S>
using Pass = _S<_Pack...>;
template <int _i>
using At = typename O<_i>
::template Pass<First>;
};
template <int _i>
using At = typename List<int, char>
::template At<_i>;
template <int _i>
void func_crash(At<_i>&) {}
int main(int argc, char *argv[])
{
char ccc;
int iii;
func_crash<0>(iii);
}
================================================
GCC 5.0.0 (20141111) output:
prog.cc: In instantiation of 'void func_crash(At<_i>&) [with int _i = 0; At<_i>
= int]':
prog.cc:31:6: internal compiler error: in write_name, at cp/mangle.c:801
void func_crash(At<_i>&) {}
^
More information about the Gcc-bugs
mailing list