aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-11 01:17:32 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-11-11 01:17:32 -0500
commit9c8b521559a6574dfe1dc7280eff9b41af2b0d5b (patch)
tree13ef2aa7d1ce3349e5c6648eb468da5e745869ca /gcc/cp
parent72b53e21bd8a0d8136df0026956e47adec1f27ac (diff)
downloadgcc-9c8b521559a6574dfe1dc7280eff9b41af2b0d5b.zip
gcc-9c8b521559a6574dfe1dc7280eff9b41af2b0d5b.tar.gz
gcc-9c8b521559a6574dfe1dc7280eff9b41af2b0d5b.tar.bz2
re PR c++/46420 ([C++0X][4.6 regression] ICE: in tsubst_copy, at cp/pt.c:11677)
PR c++/46420 * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: New case. [CONSTRUCTOR]: Use the tsubsted type. From-SVN: r166592
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c7
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f85f4b1..75c0c53 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2010-11-10 Jason Merrill <jason@redhat.com>
+ PR c++/46420
+ * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: New case.
+ [CONSTRUCTOR]: Use the tsubsted type.
+
PR c++/46369
* semantics.c (cxx_eval_bit_field_ref): New.
(cxx_eval_constant_expression): Call it.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7a06038..56b7543 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13197,6 +13197,7 @@ tsubst_copy_and_build (tree t,
if (TREE_HAS_CONSTRUCTOR (t))
return finish_compound_literal (type, r);
+ TREE_TYPE (r) = type;
return r;
}
@@ -13316,6 +13317,12 @@ tsubst_copy_and_build (tree t,
return build_lambda_object (r);
}
+ case TARGET_EXPR:
+ /* 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)));
+
default:
/* Handle Objective-C++ constructs, if appropriate. */
{