This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/85049] [8 Regression] Internal compiler error with __integer_pack


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85049

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |redi at gcc dot gnu.org
   Target Milestone|---                         |8.0
            Summary|Internal compiler error     |[8 Regression] Internal
                   |with __integer_pack         |compiler error with
                   |                            |__integer_pack

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
__integer_pack is a builtin template introduced in r248384 and introduced into
libstdc++ with r252923.
Testcase that matches exactly what libstdc++ does for index_sequence_for:

typedef __SIZE_TYPE__ size_t;
template<typename _Tp, _Tp... _Idx>
struct integer_sequence
{
  typedef _Tp value_type;
  static constexpr size_t size() noexcept { return sizeof...(_Idx); }
};
template<typename _Tp, _Tp _Num>
using make_integer_sequence = integer_sequence<_Tp, __integer_pack(_Num)...>;
template<size_t _Num>
using make_index_sequence = make_integer_sequence<size_t, _Num>;
template<typename... _Types>
using index_sequence_for = make_index_sequence<sizeof...(_Types)>;
template <typename...>
struct tuple {};
template <typename... Ts>
int get(tuple<index_sequence_for<Ts...>, Ts...>);
int x = get(tuple<index_sequence_for<>>{});

and this ICEs without any errors.
#include <utility>
template <typename...>
struct tuple {};
template <typename... Ts>
int get(tuple<std::index_sequence_for<Ts...>, Ts...>);
int x = get(tuple<std::index_sequence_for<>>{});
is accepted by 7.x and thus this is a regression from 7.x.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]