From: Jakub Jelinek Date: Thu, 2 Jan 2020 17:29:59 +0000 (+0100) Subject: re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node'... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a08009efaaeddde930e20f2669fd542422eec31;p=gcc.git re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type) PR c/90677 * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name has not been found, rather than error_mark_node. * c-c++-common/pr90677-2.c: New test. From-SVN: r279840 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 35cd60e7686..35b954ca6b2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2020-01-02 Jakub Jelinek + + PR c/90677 + * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name + has not been found, rather than error_mark_node. + 2020-01-01 Jakub Jelinek Update copyright years. diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index d2a6800c4b2..42eb5ac033b 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -354,8 +354,11 @@ identifier_global_value (tree name) tree identifier_global_tag (tree name) { - return lookup_qualified_name (global_namespace, name, /*prefer_type*/2, - /*complain*/false); + tree ret = lookup_qualified_name (global_namespace, name, /*prefer_type*/2, + /*complain*/false); + if (ret == error_mark_node) + return NULL_TREE; + return ret; } /* Returns true if NAME refers to a built-in function or function-like diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 96289dd366e..7c959f4ecb0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-02 Jakub Jelinek + + PR c/90677 + * c-c++-common/pr90677-2.c: New test. + 2020-01-02 Dennis Zhang * gcc.target/arm/multilib.exp: Add combination tests for armv8.6-a. diff --git a/gcc/testsuite/c-c++-common/pr90677-2.c b/gcc/testsuite/c-c++-common/pr90677-2.c new file mode 100644 index 00000000000..1d125e01586 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr90677-2.c @@ -0,0 +1,8 @@ +/* PR c/90677 */ +/* { dg-do compile } */ +/* { dg-options "-W -Wall" } */ + +extern void foo (int, int, const char *, ...) + __attribute__ ((__format__ (__gcc_tdiag__, 3, 4))); +struct cgraph_node; +extern void bar (struct cgraph_node *);