https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120775
--- Comment #30 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Playing around, just pure - refl = cxx_constant_value (refl); + refl = fold_non_dependent_expr (refl, tf_warning_or_error, true); fixes the testcase too (and nothing in testsuite fails), but I'd think I'd still prefer - refl = cxx_constant_value (refl); + if (processing_template_decl) + refl = fold_non_dependent_expr (refl, tf_warning_or_error, true); + else + refl = cxx_constant_value (refl); because it can give better diagnostics outside of template.
