]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/90677 (gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node'...
authorJakub Jelinek <jakub@redhat.com>
Thu, 2 Jan 2020 17:36:50 +0000 (18:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 2 Jan 2020 17:36:50 +0000 (18:36 +0100)
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: r279841

gcc/cp/ChangeLog
gcc/cp/cp-objcp-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/pr90677-2.c [new file with mode: 0644]

index b2e49a4da4c45ac045d4b2129c8b172d7830e858..0d9b1806a51fd2cca3037bf68226c3abdb648f7e 100644 (file)
@@ -1,3 +1,9 @@
+2020-01-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/90677
+       * cp-objcp-common.c (identifier_global_tag): Return NULL_TREE if name
+       has not been found, rather than error_mark_node.
+
 2019-12-20  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index a1c976e33a1c26b777f473204408c5c55552c3b9..4118ab8a31d6176ea1fe7ae8f4da7b777deefe3e 100644 (file)
@@ -357,8 +357,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;
 }
 
 /* Register c++-specific dumps.  */
index 122c4ef4d03195d69c6ec54118246d6d080a2ef7..25874aa79aab3f6e88cac521d01b8d40d30cc7d0 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-02  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/90677
+       * c-c++-common/pr90677-2.c: New test.
+
 2019-12-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
        Backport from trunk
diff --git a/gcc/testsuite/c-c++-common/pr90677-2.c b/gcc/testsuite/c-c++-common/pr90677-2.c
new file mode 100644 (file)
index 0000000..1d125e0
--- /dev/null
@@ -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 *);