diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-03-22 09:30:22 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-03-22 09:30:22 +0000 |
commit | 37048601f7fed81a6cef3dd46dac2280b855b53c (patch) | |
tree | 9910ce1a675c1cbcc49c6aa71199c355eb211576 /gcc/cp | |
parent | 7107fa7ca5359698d742aada7285587b2fb5ae9e (diff) | |
download | gcc-37048601f7fed81a6cef3dd46dac2280b855b53c.zip gcc-37048601f7fed81a6cef3dd46dac2280b855b53c.tar.gz gcc-37048601f7fed81a6cef3dd46dac2280b855b53c.tar.bz2 |
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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1f79100..ddac9f8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +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 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index c2adb1c..0ddf8f2 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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); } |