optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT.

* optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT.

	* g++.old-deja/g++.other/cleanup4.C: New test.

From-SVN: r38110
This commit is contained in:
Jakub Jelinek 2000-12-07 10:19:10 +01:00 committed by Jakub Jelinek
parent c0d82ab19c
commit 5eec284733
4 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2000-12-07 Jakub Jelinek <jakub@redhat.com>
* optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT.
2000-12-07 Joseph S. Myers <jsm28@cam.ac.uk>
* decl2.c (lang_decode_option): Handle -Wformat-security.

View File

@ -289,6 +289,7 @@ copy_body_r (tp, walk_subtrees, data)
{
*tp = build_stmt (EXPR_STMT,
RETURN_EXPR (return_stmt));
STMT_IS_FULL_EXPR_P (*tp) = 1;
/* And then jump to the end of the function. */
TREE_CHAIN (*tp) = goto_stmt;
}

View File

@ -1,3 +1,7 @@
2000-12-07 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/cleanup4.C: New test.
2000-12-07 Joseph S. Myers <jsm28@cam.ac.uk>
* format-sec-1.c: New test.

View File

@ -0,0 +1,34 @@
// Build don't link:
// Origin: Jakub Jelinek <jakub@redhat.com>
// Special g++ Options: -O2 -fno-exceptions
class foo
{
public:
foo ();
~foo ();
};
class bar
{
public:
bar ();
bar (const foo&);
};
int i;
foo f ();
inline bar x ()
{
switch (i)
{
case 0: return bar (f ());
default: return bar ();
}
}
bar y ()
{
return x ();
}