Commit 37048601 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/20465 (error: no matching function for call)

cp:
	PR c++/20465
	PR c++/20381
	* typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a
	template.
testsuite:
	PR c++/20465
	PR c++/20381
	* g++.dg/template/ptrmem12.C: New.

From-SVN: r96862
parent 7107fa7c
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
......
......@@ -5683,7 +5683,10 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p)
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
......
// 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>();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment