https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118355
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Maybe this, then. Also fixes bug 118047. --- a/gcc/cp/typeck2.cc +++ b/gcc/cp/typeck2.cc @@ -1571,7 +1571,7 @@ massage_init_elt (tree type, tree init, int nested, int flags, defer this folding as well. Don't call this on CONSTRUCTORs because their elements have already been folded, and we must avoid folding the result of get_nsdmi. */ - if (TREE_CODE (init) != CONSTRUCTOR) + if (!(processing_template_decl && TREE_CODE (init) == CONSTRUCTOR)) { tree t = fold_non_dependent_init (init, complain); if (TREE_CONSTANT (t))