Commit d216b2e0 by Marek Polacek Committed by Marek Polacek

re PR sanitizer/66452 ([UBSAN] *.Lubsan_data0' defined but not used)

	PR sanitizer/66452
	* toplev.c (check_global_declaration): Don't warn about artificial
	decls.

	* g++.dg/ubsan/pr66452.C: New test.

From-SVN: r224216
parent 02de9c16
2015-06-08 Marek Polacek <polacek@redhat.com>
PR sanitizer/66452
* toplev.c (check_global_declaration): Don't warn about artificial
decls.
2015-06-08 Tom de Vries <tom@codesourcery.com> 2015-06-08 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/66436 PR tree-optimization/66436
......
2015-06-08 Marek Polacek <polacek@redhat.com>
PR sanitizer/66452
* g++.dg/ubsan/pr66452.C: New test.
2015-06-08 Tom de Vries <tom@codesourcery.com> 2015-06-08 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/66436 PR tree-optimization/66436
......
// PR sanitizer/66452
// { dg-do compile }
// { dg-options "-Wall -fsanitize=undefined" }
class A {
public:
A(int);
};
class B {
A m_fn1() const;
};
A B::m_fn1() const {
for (int i = 0;i;)
;
return 0;
}
...@@ -534,6 +534,7 @@ check_global_declaration (tree decl) ...@@ -534,6 +534,7 @@ check_global_declaration (tree decl)
to handle multiple external decls in different scopes. */ to handle multiple external decls in different scopes. */
&& ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl))) && ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
&& ! DECL_EXTERNAL (decl) && ! DECL_EXTERNAL (decl)
&& ! DECL_ARTIFICIAL (decl)
&& ! TREE_PUBLIC (decl) && ! TREE_PUBLIC (decl)
/* A volatile variable might be used in some non-obvious way. */ /* A volatile variable might be used in some non-obvious way. */
&& ! TREE_THIS_VOLATILE (decl) && ! TREE_THIS_VOLATILE (decl)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment