re PR c++/64727 (g++.dg/torture/darwin-cfstring-3.C:11:80: internal compiler error...
authorJason Merrill <jason@redhat.com>
Fri, 23 Jan 2015 14:59:10 +0000 (09:59 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 23 Jan 2015 14:59:10 +0000 (09:59 -0500)
PR c++/64727
* constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
of CONST_DECL.

From-SVN: r220041

gcc/cp/ChangeLog
gcc/cp/constexpr.c

index 6e3a2e566fab78fa898d8b434df500264eb882db..b1d4965cc3977a3d70d8d38831c8043c3597b856 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/64727
+       * constexpr.c (cxx_eval_constant_expression): Allow for lvalue use
+       of CONST_DECL.
+
 2015-01-21  Jason Merrill  <jason@redhat.com>
 
        PR c++/64603
index 7853d377849bbeeef2276b59bf4d9f549a192c07..f144ab01d247603f5f65d1f3b494330f68ce2be7 100644 (file)
@@ -2955,10 +2955,11 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
       return (*ctx->values->get (t));
 
     case VAR_DECL:
+    case CONST_DECL:
+      /* We used to not check lval for CONST_DECL, but darwin.c uses
+        CONST_DECL for aggregate constants.  */
       if (lval)
        return t;
-      /* else fall through. */
-    case CONST_DECL:
       if (ctx->strict)
        r = decl_really_constant_value (t);
       else