From 87dc3d0d36a8ac55122da72cf5b1dcf06e694018 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 4 Mar 2021 13:31:52 +0100 Subject: [PATCH] Handle ERROR_MARK in direct_abstract_declarator The gcc.dg/noncompile/pr79758.c testcase prints pr79758.c:5:6: error: redefinition of 'fn1' 'error_mark' not supported by direct_abstract_declarator)'/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/noncompile/pr79758.c:4:6: note: previous definition of 'fn1' with type which shows a) re-entry of pp_printf via pp_unsupported_tree and b) a bogus diagnostic. The following handles ERROR_MARK in direct_abstract_declarator, yielding in the better /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/noncompile/pr79758.c:5:6: error: redefinition of 'fn1' /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/noncompile/pr79758.c:4:6: note: previous definition of 'fn1' with type 'void()' but still maybe not perfect. 2021-03-04 Richard Biener gcc/c-family/ * c-pretty-print.c (c_pretty_printer::direct_abstract_declarator): Handle ERROR_MARK. --- gcc/c-family/c-pretty-print.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 2095d4b..a987da4 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -676,6 +676,7 @@ c_pretty_printer::direct_abstract_declarator (tree t) case VECTOR_TYPE: case COMPLEX_TYPE: case TYPE_DECL: + case ERROR_MARK: break; default: -- 2.7.4