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

            Bug ID: 86931
           Summary: constexpr variable initialization: internal compiler
                    error: in reshape_init_r, at cp/decl.c:6042
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janniksilvanus at gmail dot com
  Target Milestone: ---

: g++ --version
g++ (SUSE Linux) 8.1.1 20180719 [gcc-8-branch revision 262874]
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


: cat internal_compiler_error.ii 
template <typename T>
struct Array {
   T data[2];
};

template <typename Applier>
void test(
   Applier const &)
{
   auto constexpr data = Array<int>{0, 0};
}

void instantiate()
{
   test([](){});
}


: g++ --std=c++1z internal_compiler_error.ii -c
internal_compiler_error.ii: In instantiation of ‘void test(const Applier&)
[with Applier = instantiate()::<lambda()>]’:
internal_compiler_error.ii:15:15:   required from here
internal_compiler_error.ii:10:19: internal compiler error: in reshape_init_r,
at cp/decl.c:6152
    auto constexpr data = Array<int>{0, 0};
                   ^~~~

Note the similarity with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86930,
may be related.

Reply via email to