https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63904
Bug ID: 63904
Summary: ICE when acessing array member of constexpr struct
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc-bugzilla at bmevers dot de
Created attachment 33994
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33994&action=edit
Preprocessed source
The following code causes an internal compiler error:
template<int N>
struct foo {
constexpr foo() : a() {}
int a[N];
};
int main() {
foo< (foo<1>{}).a[0] > f;
}
constexpr-initalization.cpp:7:25: in constexpr expansion of
‘f.foo<N>::foo<0>()’
constexpr-initalization.cpp:7:25: internal compiler error: in tree_low_cst, at
tree.h:4849
foo< (foo<1>{}).a[0] > f;