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]

C++ PATCH for c++/81236, missed 'this' capture with template-id in generic lambda


The problem here was that normally in finish_id_expression we add
'this->' to a mention of a non-static member, but there is special
code for doing less if the lookup result is dependent, and so we
didn't get that processing.

A few months back Adam fixed 64382 by deciding to do all the normal
processing if we're in a generic lambda in a template, but in this
testcase the generic lambda isn't in a template.

We could approach this by extending that change to all generic
lambdas, and that might be appropriate for GCC 7, but it seems to me
that this approach will just mean any problems with doing all the
normal processing in a template will remain latent until someone
happens to use them in a generic lambda; instead, this patch removes
the template special case and fixes the normal code to work properly
in templates.

The cp_parser_postfix_dot_deref_expression hunk was a latent
diagnostic quality issue: there's no point in trying to be permissive
about an incomplete type like void, since it can't be completed by
instantiation time.

The cp_walk_subtrees hunk was necessary to make abi-tag21.C work with
this change; without walking into the scope of the BASELINK, we didn't
see the explicit scope in the return type of fv.

Tested x86_64-pc-linux-gnu, applying to trunk.

Attachment: generic-tid.diff
Description: Text document


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