summaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-23 07:40:04 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-23 07:40:04 +0000
commit0638c4341faf188e902f4f98745069f9edf6449b (patch)
treed3c9d42deb43cc0a2a85375a47e5680b0096e26c /gcc/cp/decl2.c
parenta08df2f0eaa385c59b0b14aef72aae936dc25157 (diff)
downloadgcc-0638c4341faf188e902f4f98745069f9edf6449b.tar.gz
PR c++/25369
* g++.dg/template/ptrmem16.C: New test. PR c++/25369 * tree.c (really_overloaded_fn): Tweak comment. * pt.c (tsubst_call_declarator_parms): Remove. (tsubst_copy): Call mark_used on the member referenced by an OFFSET_REF. * semantics.c (finish_qualified_id_expr): Simplify. * decl2.c (mark_used): Accept BASELINKs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109010 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8c65d946a97..10296a708a1 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -3233,14 +3233,27 @@ check_default_args (tree x)
}
}
-/* Mark DECL as "used" in the program. If DECL is a specialization or
- implicitly declared class member, generate the actual definition. */
+/* Mark DECL (eithet a _DECL or a BASELINK) as "used" in the program.
+ If DECL is a specialization or implicitly declared class member,
+ generate the actual definition. */
void
mark_used (tree decl)
{
HOST_WIDE_INT saved_processing_template_decl = 0;
+ /* If DECL is a BASELINK for a single function, then treat it just
+ like the DECL for the function. Otherwise, if the BASELINK is
+ for an overloaded function, we don't know which function was
+ actually used until after overload resolution. */
+ if (TREE_CODE (decl) == BASELINK)
+ {
+ decl = BASELINK_FUNCTIONS (decl);
+ if (really_overloaded_fn (decl))
+ return;
+ decl = OVL_CURRENT (decl);
+ }
+
TREE_USED (decl) = 1;
/* If we don't need a value, then we don't need to synthesize DECL. */
if (skip_evaluation)