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

            Bug ID: 80864
           Summary: Brace-initialization of a constexpr variable of an
                    array in a POD triggers ICE from templates
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: oss at florianjw dot de
  Target Milestone: ---

The following code triggers an ICE in GCC 6.3.0 and 6.3.1 under independent
systems:

``````````````````````````````````````````````````````````````````````````
struct array {
        char c[1];
};

template <typename T>
void gun() {
        constexpr auto c = array{{}};
}

void fun() {
        gun<int>();
}
``````````````````````````````````````````````````````````````````````````

`g++ test.cpp`:

``````````````````````````````````````````````````````````````````````````
test.cpp: In instantiation of ‘void gun() [with T = int]’:
test.cpp:13:11:   required from here
test.cpp:8:29: internal compiler error: in reshape_init_r, at cp/decl.c:5898
  constexpr auto c = array{{}};
                             ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
``````````````````````````````````````````````````````````````````````````

I didn't find a bug-report with this exact problem, but this one could possibly
be related:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79607

Reply via email to