aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-10-13 17:23:47 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-10-13 17:23:47 -0400
commit2598165f09a96f60aa53abebf931718a769b7cf2 (patch)
tree6bfe09b345ceaed634c1718cf2d97aba8fa3b824 /gcc/cp/pt.c
parent0e81aa85294d479dea3fb9b5a71e6f7242770af6 (diff)
downloadgcc-2598165f09a96f60aa53abebf931718a769b7cf2.zip
gcc-2598165f09a96f60aa53abebf931718a769b7cf2.tar.gz
gcc-2598165f09a96f60aa53abebf931718a769b7cf2.tar.bz2
re PR c++/50614 ([C++0x] ICE: tree check: expected field_decl, have identifier_node in component_ref_field_offset, at expr.c:6697 with -fcompare-debug and a non-static initializer)
PR c++/50614 * cp-tree.h (VAR_TEMPL_TYPE_FIELD_OR_FUNCTION_DECL_CHECK): New. (DECL_TEMPLATE_INFO): Use it. * pt.c (tsubst_decl) [FIELD_DECL]: Set DECL_TEMPLATE_INFO if the decl has an NSDMI. * init.c (perform_member_init): Use it. From-SVN: r179945
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 880f3d1..1632c01 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10269,6 +10269,16 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
= tsubst_expr (DECL_INITIAL (t), args,
complain, in_decl,
/*integral_constant_expression_p=*/true);
+ else if (DECL_INITIAL (t))
+ {
+ /* Set up DECL_TEMPLATE_INFO so that we can get at the
+ NSDMI in perform_member_init. Still set DECL_INITIAL
+ to error_mark_node so that we know there is one. */
+ DECL_INITIAL (r) = error_mark_node;
+ gcc_assert (DECL_LANG_SPECIFIC (r) == NULL);
+ retrofit_lang_decl (r);
+ DECL_TEMPLATE_INFO (r) = build_template_info (t, args);
+ }
/* We don't have to set DECL_CONTEXT here; it is set by
finish_member_declaration. */
DECL_CHAIN (r) = NULL_TREE;