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
This commit is contained in:
parent
02de9c16f0
commit
d216b2e085
@ -1,3 +1,9 @@
|
||||
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>
|
||||
|
||||
PR tree-optimization/66436
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR tree-optimization/66436
|
||||
|
16
gcc/testsuite/g++.dg/ubsan/pr66452.C
Normal file
16
gcc/testsuite/g++.dg/ubsan/pr66452.C
Normal file
@ -0,0 +1,16 @@
|
||||
// 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)
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user