aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e7a886380c2..3c0e7d80213 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4897,6 +4897,9 @@ tsubst_friend_function (tree decl, tree args)
Then, in S<int>, template <class U> void f(int, U) is not an
instantiation of anything. */
+ if (new_friend == error_mark_node)
+ return error_mark_node;
+
DECL_USE_TEMPLATE (new_friend) = 0;
if (TREE_CODE (decl) == TEMPLATE_DECL)
{