diff options
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r-- | gcc/cp/expr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index 133a01b..93477bc 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -353,7 +353,13 @@ fold_for_warn (tree x) /* It's not generally safe to fully fold inside of a template, so call fold_non_dependent_expr instead. */ if (processing_template_decl) - return fold_non_dependent_expr (x); + { + tree f = fold_non_dependent_expr (x, tf_none); + if (f == error_mark_node) + return x; + else + return f; + } return c_fully_fold (x, /*for_init*/false, /*maybe_constp*/NULL); } |