summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-08 10:35:24 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2015-06-08 10:35:24 +0000
commit73118c48bba686185e5f819e8efc358dc754f04f (patch)
tree93ce0d946ae170a99309f45479b8831c3c43ed81 /gcc/toplev.c
parenteac25264ebcfd82871dec732d818cbd1f4dc987c (diff)
downloadgcc-73118c48bba686185e5f819e8efc358dc754f04f.tar.gz
PR sanitizer/66452
* toplev.c (check_global_declaration): Don't warn about artificial decls. * g++.dg/ubsan/pr66452.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224216 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index fd2ac4e7f2e..eb8b8ac1759 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -534,6 +534,7 @@ check_global_declaration (tree decl)
to handle multiple external decls in different scopes. */
&& ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
&& ! DECL_EXTERNAL (decl)
+ && ! DECL_ARTIFICIAL (decl)
&& ! TREE_PUBLIC (decl)
/* A volatile variable might be used in some non-obvious way. */
&& ! TREE_THIS_VOLATILE (decl)