mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-05 00:31:30 +08:00
re PR c++/79825 (Uninitialized uses in aggregate copies of empty structs (missed DCE in C++ gimplify))
2017-03-03 Richard Biener <rguenther@suse.de> PR c++/79825 * cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR. * g++.dg/warn/Wuninitialized-8.C: New testcase. From-SVN: r245866
This commit is contained in:
parent
38801de50f
commit
30d309aaf1
@ -1,3 +1,8 @@
|
||||
2017-03-03 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR c++/79825
|
||||
* cp-gimplify.c (simple_empty_class_p): Handle EMPTY_CLASS_EXPR.
|
||||
|
||||
2017-03-03 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/79791
|
||||
|
@ -549,6 +549,7 @@ simple_empty_class_p (tree type, tree op)
|
||||
return
|
||||
((TREE_CODE (op) == COMPOUND_EXPR
|
||||
&& simple_empty_class_p (type, TREE_OPERAND (op, 1)))
|
||||
|| TREE_CODE (op) == EMPTY_CLASS_EXPR
|
||||
|| is_gimple_lvalue (op)
|
||||
|| INDIRECT_REF_P (op)
|
||||
|| (TREE_CODE (op) == CONSTRUCTOR
|
||||
|
@ -1,3 +1,8 @@
|
||||
2017-03-03 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR c++/79825
|
||||
* g++.dg/warn/Wuninitialized-8.C: New testcase.
|
||||
|
||||
2017-03-03 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gcc.dg/pr57134.c: Use empty inline asm string literal.
|
||||
|
18
gcc/testsuite/g++.dg/warn/Wuninitialized-8.C
Normal file
18
gcc/testsuite/g++.dg/warn/Wuninitialized-8.C
Normal file
@ -0,0 +1,18 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-Wuninitialized" }
|
||||
|
||||
struct A;
|
||||
struct B
|
||||
{
|
||||
B(A);
|
||||
};
|
||||
struct C
|
||||
{
|
||||
template <typename PassT> void m_fn1(PassT p1) { new B(p1); } // { dg-bogus "uninitialized" }
|
||||
};
|
||||
struct A {};
|
||||
void fn1()
|
||||
{
|
||||
C a;
|
||||
a.m_fn1(A());
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user