aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-08-16 19:25:52 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-08-16 19:25:52 -0400
commit4951efb6c95bd58056dae36cea2b9a89a3983ecd (patch)
treeb8b069b2bb944d9161a0ef3d7864da6dc6f40a9b /gcc/cp
parent098416302ba1d50a7f183e8643a2563a255b744a (diff)
downloadgcc-4951efb6c95bd58056dae36cea2b9a89a3983ecd.zip
gcc-4951efb6c95bd58056dae36cea2b9a89a3983ecd.tar.gz
gcc-4951efb6c95bd58056dae36cea2b9a89a3983ecd.tar.bz2
pt.c (instantiate_class_template_1): If DECL_PRESERVE_P is set on a member function or static data member...
* pt.c (instantiate_class_template_1): If DECL_PRESERVE_P is set on a member function or static data member, call mark_used. From-SVN: r177811
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ea1a8d0..c06a307 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2011-08-16 Jason Merrill <jason@redhat.com>
+ * pt.c (instantiate_class_template_1): If DECL_PRESERVE_P is set
+ on a member function or static data member, call mark_used.
+
PR c++/50054
* typeck2.c (cxx_incomplete_type_diagnostic): Handle
init_list_type_node.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 10fdced..9a4419a 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8675,6 +8675,9 @@ instantiate_class_template_1 (tree type)
--processing_template_decl;
set_current_access_from_decl (r);
finish_member_declaration (r);
+ /* Instantiate members marked with attribute used. */
+ if (r != error_mark_node && DECL_PRESERVE_P (r))
+ mark_used (r);
}
else
{
@@ -8724,6 +8727,9 @@ instantiate_class_template_1 (tree type)
/*init_const_expr_p=*/false,
/*asmspec_tree=*/NULL_TREE,
/*flags=*/0);
+ /* Instantiate members marked with attribute used. */
+ if (r != error_mark_node && DECL_PRESERVE_P (r))
+ mark_used (r);
}
else if (TREE_CODE (r) == FIELD_DECL)
{