+2006-02-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ Backport:
+ 2005-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25369
+ * pt.c (tsubst_copy): Call mark_used on the member referenced by an
+ OFFSET_REF.
+ * decl2.c (mark_used): Accept BASELINKs.
+
2006-02-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Backport:
void
mark_used (tree decl)
{
+ /* 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 (processing_template_decl || skip_evaluation)
return;
in_decl),
tsubst (TREE_TYPE (t), args, complain, in_decl));
+ case OFFSET_REF:
+ mark_used (TREE_OPERAND (t, 1));
+ return t;
+
default:
return t;
}
+2006-02-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ Backport:
+ 2005-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/25369
+ * g++.dg/template/ptrmem16.C: New test.
+
2006-02-01 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Backport:
--- /dev/null
+// PR c++/25369
+// { dg-do link }
+
+template <typename> struct A
+{
+ void foo() {}
+};
+
+void bar(void (A<int>::*)()) {}
+
+template <int> void baz()
+{
+ bar(&A<int>::foo);
+}
+
+int main()
+{
+ baz<0>();
+ return 0;
+}
+
+