From: Jason Merrill Date: Thu, 3 Mar 2011 16:51:20 +0000 (-0500) Subject: re PR c++/47950 ([C++0x] Internal compiler error: non-dependent declaration as condit... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff4bfb1056a816c881c9ffb0314b2ff202b32d03;p=gcc.git re PR c++/47950 ([C++0x] Internal compiler error: non-dependent declaration as condition causes tsubst_copy_and_build assertion failure.) PR c++/47950 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT. From-SVN: r170656 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 264bc7c7ed9..ef766fbff3d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-03-03 Jason Merrill + + PR c++/47950 + * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Retain TREE_CONSTANT. + 2011-03-02 Jason Merrill PR c++/47950 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4b262d00016..60b26996c47 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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. */