+2005-03-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20465
+ PR c++/20381
+ * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a
+ template.
+
2005-03-21 Paolo Carlini <pcarlini@suse.de>
PR c++/20461
return instantiate_type (type, pfn, tf_error | tf_warning);
fn = TREE_OPERAND (pfn, 0);
- gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
+ gcc_assert (TREE_CODE (fn) == FUNCTION_DECL
+ /* In a template, we will have preserved the
+ OFFSET_REF. */
+ || (processing_template_decl && TREE_CODE (fn) == OFFSET_REF));
return make_ptrmem_cst (to_type, fn);
}
+2005-03-22 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/20465
+ PR c++/20381
+ * g++.dg/template/ptrmem12.C: New.
+
2005-03-22 Hans-Peter Nilsson <hp@axis.com>
PR rtl-optimization/20527
--- /dev/null
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Mar 2005 <nathan@codesourcery.com>
+
+// PR 20465
+// Origin: Matthias Klose <doko@debian.org>
+// Andrew Pinski <pinskia@gcc.gnu.org>
+
+template <class _Ret, class _Tp>
+void mem_fun_ref(_Ret (_Tp::*__f)());
+
+struct A {
+ double f();
+};
+
+void h ()
+{
+ mem_fun_ref(&A::f);
+}
+
+template <class T>
+void f()
+{
+ mem_fun_ref(&A::f);
+}
+
+void g()
+{
+ f<int>();
+}