re PR c++/55419 (ICE in gimplify_init_ctor_preeval, at gimplify.c:3587)
PR c++/55419 * tree.c (build_target_expr): Don't set TREE_CONSTANT. From-SVN: r194317
This commit is contained in:
parent
3da2b176b3
commit
4eaee921fa
@ -1,3 +1,8 @@
|
||||
2012-12-07 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/55419
|
||||
* tree.c (build_target_expr): Don't set TREE_CONSTANT.
|
||||
|
||||
2012-12-07 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
PR c++/55513
|
||||
|
@ -329,8 +329,6 @@ build_target_expr (tree decl, tree value, tsubst_flags_t complain)
|
||||
side-effects, then the optimizer should be able to get rid of
|
||||
whatever code is generated anyhow. */
|
||||
TREE_SIDE_EFFECTS (t) = 1;
|
||||
if (literal_type_p (type))
|
||||
TREE_CONSTANT (t) = TREE_CONSTANT (value);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
27
gcc/testsuite/g++.dg/cpp0x/constexpr-initlist6.C
Normal file
27
gcc/testsuite/g++.dg/cpp0x/constexpr-initlist6.C
Normal file
@ -0,0 +1,27 @@
|
||||
// PR c++/55419
|
||||
// { dg-options -std=c++11 }
|
||||
|
||||
struct P
|
||||
{
|
||||
P () = default;
|
||||
explicit constexpr P (int x) : p (x) {}
|
||||
int p;
|
||||
};
|
||||
|
||||
struct Q
|
||||
{
|
||||
constexpr Q () : q (0x7f) {}
|
||||
int q;
|
||||
};
|
||||
|
||||
struct R
|
||||
{
|
||||
Q q;
|
||||
P p;
|
||||
};
|
||||
|
||||
void
|
||||
foo (R *x)
|
||||
{
|
||||
*x = {};
|
||||
}
|
Loading…
Reference in New Issue
Block a user