This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [C++ Patch] PR 57543


Hi,

On 05/27/2014 07:15 PM, Jason Merrill wrote:
I don't think this is the right place for the fix; why do we have a dummy object at all? Doesn't maybe_dummy_object return current_class_ref in this situation?
I see, thanks for the dummy object clarification.

Therefore, it seems to me that the real issue is that current_class_ref is null when maybe_dummy_object is called in the template case, vs the non-template case where cp_parser_late_return_type_opt calls inject_this_parameter. Thus the below, which at least passes testing.

The most tricky case is tested with struct Z: in that case tsubst_function_type is called , via 3/4 hops, from fn_type_unification, thus the former cannot simply use current_class_type, which is null. I tried to cope with that by using DECL_CONTEXT (in_decl) but then fn_type_unification has to pass the actual TEMPLATE_DECL as in_decl, not NULL_TREE. Is that reasonable??

Thanks!
Paolo.

////////////////////

Attachment: patch_57543_2
Description: Text document


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