re PR c++/16851 (ICE when throwing a comma expression)
PR c++/16851 * tree.c (stabilize_init): See through a COMPOUND_EXPR. From-SVN: r86688
This commit is contained in:
parent
40aac94801
commit
bcac21a0c6
3 changed files with 13 additions and 0 deletions
|
@ -1,5 +1,8 @@
|
|||
2004-08-27 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/16851
|
||||
* tree.c (stabilize_init): See through a COMPOUND_EXPR.
|
||||
|
||||
PR c++/13684
|
||||
* decl.c (expand_static_init): Use thread-safety API.
|
||||
(register_dtor_fn): Return the call, don't expand it.
|
||||
|
|
|
@ -2316,6 +2316,8 @@ stabilize_init (tree init, tree *initp)
|
|||
t = TREE_OPERAND (t, 1);
|
||||
if (TREE_CODE (t) == TARGET_EXPR)
|
||||
t = TARGET_EXPR_INITIAL (t);
|
||||
if (TREE_CODE (t) == COMPOUND_EXPR)
|
||||
t = expr_last (t);
|
||||
if (TREE_CODE (t) == CONSTRUCTOR
|
||||
&& CONSTRUCTOR_ELTS (t) == NULL_TREE)
|
||||
{
|
||||
|
|
8
gcc/testsuite/g++.dg/eh/throw2.C
Normal file
8
gcc/testsuite/g++.dg/eh/throw2.C
Normal file
|
@ -0,0 +1,8 @@
|
|||
// PR c++/16851
|
||||
|
||||
struct A { A(int); };
|
||||
|
||||
void f()
|
||||
{
|
||||
throw (3,A(t));
|
||||
}
|
Loading…
Add table
Reference in a new issue