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

            Bug ID: 89336
           Summary: internal compiler error when compiling a constexpr
                    function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marek at telnyx dot com
  Target Milestone: ---

g++ version: 8.2.0

Trying to compile the following source causes internal compiler error:
-------
#include <array>

constexpr std::array<int, 256> prepare()
{
  std::array<int, 256> r = {0};
  for ( int i = 0; i < 6; ++i )
  {
    r[i + 'a'] = r[i + 'A'] = i + 10;
  }
  return r;
}


int main()
{
  auto v = prepare();
  return 0;
}
-------

g++ -std=c++17 xx.cpp 
xx.cpp: In function ‘int main()’:
xx.cpp:16:20: internal compiler error: Segmentation fault
   auto v = prepare();

Reply via email to