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++/83227] New: [7 Regression] internal compiler error: in process_init_constructor_array


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

            Bug ID: 83227
           Summary: [7 Regression] internal compiler error: in
                    process_init_constructor_array
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sgunderson at bigfoot dot com
  Target Milestone: ---

I believe this is distinct from #82593, so I'm filing it as a separate bug.

The following test program dies with GCC 7.2.0 with -std=c++17:

#include <initializer_list>
#include <vector>

struct Direction {
 Direction() {}
};

struct Front_back : public Direction {
  Front_back() : Direction() {}
};

void foo(const std::vector<Direction> &elements);

void bar() {
  foo({ Front_back{} });
}

test.cc: In function ‘void bar()’:
test.cc:15:23: internal compiler error: in process_init_constructor_array, at
cp/typeck2.c:1308
   foo({ Front_back{} });
                       ^
Please submit a full bug report,
with preprocessed source if appropriate.

It works with GCC 6.4.0, and also with -std=c++14. It's still there in the
20171109 snapshot.

Reduced preprocessed case:

namespace std {
template <class a> class initializer_list {
  const a *b;
  unsigned long c;
};
struct e {
  e(int);
};
template <typename d> class f : e {
public:
  f(initializer_list<d>, int g = int()) : e(g) {}
};
}
struct h {};
struct i : h {
  i();
};
void foo(std::f<h>) { foo({i{}}); }

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