re PR c++/47950 ([C++0x] Internal compiler error: non-dependent declaration as condit...
authorJason Merrill <jason@redhat.com>
Thu, 3 Mar 2011 16:51:20 +0000 (11:51 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 3 Mar 2011 16:51:20 +0000 (11:51 -0500)
PR c++/47950
* pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT.

From-SVN: r170656

gcc/cp/ChangeLog
gcc/cp/pt.c

index 264bc7c7ed9ff0c0b2bf62e04cf97888f9e52b15..ef766fbff3dfb1a2924bc8149c2b286b7b99dcc1 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-03  Jason Merrill  <jason@redhat.com>
+
+       PR c++/47950
+       * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT.
+
 2011-03-02  Jason Merrill  <jason@redhat.com>
 
        PR c++/47950
index 4b262d00016d78c54a472cac32567b20a37d0295..60b26996c47cb95f79b48a1a785f432d51e76e89 100644 (file)
@@ -13368,7 +13368,11 @@ tsubst_copy_and_build (tree t,
       /* We can get here for a constant initializer of non-dependent type.
          FIXME stop folding in cp_parser_initializer_clause.  */
       gcc_assert (TREE_CONSTANT (t));
-      return get_target_expr (RECUR (TARGET_EXPR_INITIAL (t)));
+      {
+       tree r = get_target_expr (RECUR (TARGET_EXPR_INITIAL (t)));
+       TREE_CONSTANT (r) = true;
+       return r;
+      }
 
     default:
       /* Handle Objective-C++ constructs, if appropriate.  */