https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85470
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- --- gcc/cp/typeck2.c.jj 2018-04-19 15:57:36.765482568 +0200 +++ gcc/cp/typeck2.c 2018-04-19 19:32:43.335986274 +0200 @@ -824,7 +824,9 @@ store_init_value (tree decl, tree init, bool const_init; value = fold_non_dependent_expr (value); if (DECL_DECLARED_CONSTEXPR_P (decl) - || (DECL_IN_AGGR_P (decl) && !DECL_VAR_DECLARED_INLINE_P (decl))) + || (DECL_CLASS_SCOPE_P (decl) + && DECL_INITIALIZED_IN_CLASS_P (decl) + && !DECL_VAR_DECLARED_INLINE_P (decl))) { /* Diagnose a non-constant initializer for constexpr. */ if (!require_constant_expression (value)) just changes the error, from pr85470.C:13:75: error: call to non-‘constexpr’ function ‘static T& StaticObject<T>::create() [with T = int]’ to pr85470.C:13:24: error: non-constant in-class initialization invalid for static member ‘StaticObject<int>::instance’ cpp0x/overflow1.C still PASSes.