* tree.c (build_target_expr): Don't set TREE_CONSTANT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194317
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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;
}
--- /dev/null
+// 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 = {};
+}