Index: tree.h =================================================================== --- tree.h (revision 174893) +++ tree.h (working copy) @@ -4053,6 +4053,12 @@ enum ptrmemfunc_vbit_where_t #define NULL_TREE (tree) NULL +/* True if NODE is an erroneous expression. */ + +#define error_operand_p(NODE) \ + ((NODE) == error_mark_node \ + || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) + extern tree decl_assembler_name (tree); extern bool decl_assembler_name_equal (tree decl, const_tree asmname); extern hashval_t decl_assembler_name_hash (const_tree asmname); Index: cp/cp-tree.h =================================================================== --- cp/cp-tree.h (revision 174893) +++ cp/cp-tree.h (working copy) @@ -1123,12 +1123,6 @@ struct GTY(()) language_function { #define ansi_assopname(CODE) \ (assignment_operator_name_info[(int) (CODE)].identifier) -/* True if NODE is an erroneous expression. */ - -#define error_operand_p(NODE) \ - ((NODE) == error_mark_node \ - || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node)) - /* TRUE if a tree code represents a statement. */ extern bool statement_code_p[MAX_TREE_CODES]; Index: dbxout.c =================================================================== --- dbxout.c (revision 174893) +++ dbxout.c (working copy) @@ -1510,7 +1510,7 @@ dbxout_type_fields (tree type) { /* If one of the nodes is an error_mark or its type is then return early. */ - if (tem == error_mark_node || TREE_TYPE (tem) == error_mark_node) + if (error_operand_p (tem)) return; /* Omit here local type decls until we know how to support them. */ Index: go/gofrontend/expressions.cc =================================================================== --- go/gofrontend/expressions.cc (revision 174893) +++ go/gofrontend/expressions.cc (working copy) @@ -209,7 +209,7 @@ Expression::convert_for_assignment(Translate_conte if (lhs_type->is_error() || rhs_type->is_error()) return error_mark_node; - if (rhs_tree == error_mark_node || TREE_TYPE(rhs_tree) == error_mark_node) + if (error_operand_p (rhs_tree)) return error_mark_node; Gogo* gogo = context->gogo(); @@ -8967,7 +8967,7 @@ Call_expression::do_get_tree(Translate_context* co else go_unreachable(); - if (fn == error_mark_node || TREE_TYPE(fn) == error_mark_node) + if (error_operand_p (fn)) { delete[] args; return error_mark_node; @@ -11004,7 +11004,7 @@ Struct_construction_expression::do_get_tree(Transl ++pv; } - if (val == error_mark_node || TREE_TYPE(val) == error_mark_node) + if (error_operand_p (val)) return error_mark_node; constructor_elt* elt = VEC_quick_push(constructor_elt, elts, NULL); Index: c-decl.c =================================================================== --- c-decl.c (revision 174893) +++ c-decl.c (working copy) @@ -565,7 +565,7 @@ add_stmt (tree t) static bool decl_jump_unsafe (tree decl) { - if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node) + if (error_operand_p (decl)) return false; /* Always warn about crossing variably modified types. */ Index: gimplify.c =================================================================== --- gimplify.c (revision 174893) +++ gimplify.c (working copy) @@ -5448,7 +5448,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tr unsigned int nflags; tree t; - if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node) + if (error_operand_p (decl)) return; /* Never elide decls whose type has TREE_ADDRESSABLE set. This means @@ -5573,7 +5573,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, unsigned flags = in_code ? GOVD_SEEN : 0; bool ret = false, shared; - if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node) + if (error_operand_p (decl)) return false; /* Threadprivate variables are predetermined. */ @@ -5830,7 +5830,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_se do_add: decl = OMP_CLAUSE_DECL (c); - if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node) + if (error_operand_p (decl)) { remove = true; break; @@ -5889,7 +5889,7 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_se case OMP_CLAUSE_COPYIN: case OMP_CLAUSE_COPYPRIVATE: decl = OMP_CLAUSE_DECL (c); - if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node) + if (error_operand_p (decl)) { remove = true; break;