summaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d090d2da13b..6cbcd3f9c4b 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5418,6 +5418,11 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
{
tree fullname;
+ if (name == error_mark_node
+ || context == NULL_TREE
+ || context == error_mark_node)
+ return error_mark_node;
+
if (TYPE_P (name))
{
if (!(TYPE_LANG_SPECIFIC (name)