diff options
Diffstat (limited to 'gcc/cp/pt.c')
| -rw-r--r-- | gcc/cp/pt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2b124792572..38c91a0e188 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8661,10 +8661,14 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) /* If this function is a clone, handle it specially. */ if (DECL_CLONED_FUNCTION_P (tmpl)) { - tree spec = instantiate_template (DECL_CLONED_FUNCTION (tmpl), targ_ptr, - complain); + tree spec; tree clone; + spec = instantiate_template (DECL_CLONED_FUNCTION (tmpl), targ_ptr, + complain); + if (spec == error_mark_node) + return error_mark_node; + /* Look for the clone. */ for (clone = TREE_CHAIN (spec); clone && DECL_CLONED_FUNCTION_P (clone); |

