https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70139

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Disabling the trivial copy ctor shortcut handling fixes this:
--- constexpr.c.xx      2016-03-11 17:37:42.000000000 +0100
+++ constexpr.c 2016-03-18 18:18:59.579595563 +0100
@@ -1240,7 +1240,7 @@ cxx_eval_call_expression (const constexp
     }

   /* Shortcut trivial constructor/op=.  */
-  if (trivial_fn_p (fun))
+  if (trivial_fn_p (fun) && 0)
     {
       if (call_expr_nargs (t) == 2)
        {
so I bet the bug would be in there.  I'm surprised the trivial copy ctor
handling doesn't evaluate it as a store to the first argument, the first
argument isn't mentioned there at all.

Reply via email to