* semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
address, make sure the value is constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191266
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-09-13 Jason Merrill <jason@redhat.com>
+ PR c++/53839
+ * semantics.c (cxx_eval_indirect_ref): If we aren't looking for an
+ address, make sure the value is constant.
+
+2012-09-13 Jason Merrill <jason@redhat.com>
+
PR c++/54511
* pt.c (tsubst_decl) [VAR_DECL]: Handle DECL_ANON_UNION_VAR_P.
}
if (r == NULL_TREE)
- return t;
+ {
+ if (!addr)
+ VERIFY_CONSTANT (t);
+ return t;
+ }
return r;
}
2012-09-13 Jason Merrill <jason@redhat.com>
+ PR c++/53839
+ * g++.dg/cpp0x/constexpr-temp1.C: New.
+
+2012-09-13 Jason Merrill <jason@redhat.com>
+
PR c++/54511
* g++.dg/template/anonunion2.C: New.
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+struct A { int i; };
+constexpr A f2 (const A& a) { return a; }
+constexpr int f1 (const A &a) { return f2(a).i; }
+A g(const A &a)
+{
+ return { f1(a) };
+}