This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[C++] PTRMEM_CSTs


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]