diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/cp-gimplify.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attrib37.C | 14 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 40d73346081..ab5fbe5c196 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2010-02-17 Jason Merrill <jason@redhat.com> + PR c++/43093 + * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't + have an INIT_EXPR anymore. + PR c++/43079 * pt.c (convert_nontype_argument): Change assert to test. diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index cf8135037e9..df09b60c6dd 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -552,7 +552,9 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) 25979. */ case INIT_EXPR: cp_gimplify_init_expr (expr_p, pre_p, post_p); - /* Fall through. */ + if (TREE_CODE (*expr_p) != INIT_EXPR) + return GS_OK; + /* Otherwise fall through. */ case MODIFY_EXPR: { /* If the back end isn't clever enough to know that the lhs and rhs diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87e442e9552..34729bce210 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-02-17 Jason Merrill <jason@redhat.com> + PR c++/43093 + * g++.dg/ext/attrib37.C: New. + PR c++/43079 * g++.dg/template/ptrmem20.C: New. diff --git a/gcc/testsuite/g++.dg/ext/attrib37.C b/gcc/testsuite/g++.dg/ext/attrib37.C new file mode 100644 index 00000000000..ac35587892a --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib37.C @@ -0,0 +1,14 @@ +// PR c++/43093 +// { dg-do compile { target i?86-*-* } } + +struct S { + int x; + S(const S &s) {} +}; + +S __attribute__((__stdcall__)) getS(); + +void test() +{ + S s = getS(); +} |