https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96241
Bug ID: 96241
Summary: ICE in verify_ctor_sanity
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cbcode at gmail dot com
Target Milestone: ---
The following generates
internal compiler error: in verify_ctor_sanity, at cp/constexpr.c:3869
for gcc-10.1.0 (x86_64 and i686, Linux), gcc-9.x also ICEs.
gcc-8.x and gcc-7.x are fine, so are clang and intel-compiler.
enum struct enu : int {
o = 0,
p = 1,
};
constexpr enu& operator|=(enu& a, enu b) {
return a = enu(static_cast<int>(a) + static_cast<int>(b));
}
struct s {
enu e = enu::o;
};
template<typename T, int N> struct my_array {
T data[N];
};
static constexpr auto make_ss = []{
my_array<s, 1> ss = {};
//ss.data[0] = {}; //work-around to avoid ICE on next line
ss.data[0].e |= enu::p; //ICE
return ss;
}();