PR c++/65295
* constexpr.c (cxx_eval_constant_expression): Remove assert in
RESULT_DECL handling.
From-SVN: r221161
+2015-03-03 Aldy Hernandez <aldyh@redhat.com>
+
+ PR c++/65295
+ * constexpr.c (cxx_eval_constant_expression): Remove assert in
+ RESULT_DECL handling.
+
2015-02-26 Marek Polacek <polacek@redhat.com>
PR c++/65202
if (lval)
return t;
/* We ask for an rvalue for the RESULT_DECL when indirecting
- through an invisible reference. */
- gcc_assert (DECL_BY_REFERENCE (t));
+ through an invisible reference, or in named return value
+ optimization. */
return (*ctx->values->get (t));
case VAR_DECL:
--- /dev/null
+// { dg-do compile }
+// { dg-options "-std=c++1y" }
+
+struct arr {
+ constexpr arr() : elem() { }
+ char elem[17];
+};
+
+constexpr
+arr f()
+{
+ arr result;
+ return result;
+}
+
+constexpr arr a { f() };
+
+int main()
+{
+}