This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[C++] PTRMEM_CSTs
- To: gcc-bugs at gcc dot gnu dot org
- Subject: [C++] PTRMEM_CSTs
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Mon, 15 Jan 2001 14:35:28 +0000
- Organization: Codesourcery LLC
Hi,
PTRMEM_CST's hold the target type and the field/function decl. They do not
hold the BINFO when the member is in a base of the ptrmem's class type.
This means that the result of say
static_cast <int (Derived::*)()> (&Base::fn)
is not a PTRMEM_CST, but a CONSTRUCTOR that is TREE_STATIC and TREE_CONSTANT.
This amounts to the same thing, except that there are lots of cases for
code == PTRMEM_CST, which do special things. I've got an ICE in
build_overload_value where a pointer to member function's constant value happens
to not be a PTRMEM_CST.
This also impacts resolve_address_of_overloaded_function, where given a
target pointer to member type, we locate a member of a base. The current result
has a type of pointer-to-member-of-base, which is, I beleive, incorrect.
This can impact template deduction - I have a failure in convert_nontype_argument.
The test case is bug 1505, but that also invokes an infinite recursion first
at the moment.
I propose adding a field to struct ptrmem_cst to hold the BINFO and having
build_ptrmemfunc DTRT.
comments?
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org