https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72457
--- Comment #6 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- So, perhaps simply: diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 6bcb41a..83fd9a4 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -734,7 +734,7 @@ cx_check_missing_mem_inits (tree fun, tree body, bool complain) || DECL_ARTIFICIAL (index)) continue; } - for (; field != index; field = DECL_CHAIN (field)) + for (; field != NULL_TREE && field != index; field = DECL_CHAIN (field)) { tree ftype; if (TREE_CODE (field) != FIELD_DECL