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: [PATCH] v2: Don't offer suggestions for compiler-generated variables (PR c++/85515)


On Thu, Apr 26, 2018 at 8:09 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> On Thu, 2018-04-26 at 15:53 -0400, Jason Merrill wrote:
>> On Thu, Apr 26, 2018 at 3:45 AM, Richard Biener
>> <richard.guenther@gmail.com> wrote:
>> > On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell <nathan@acm.org>
>> > wrote:
>> > > On 04/25/2018 11:41 AM, David Malcolm wrote:
>> > > >
>> > > > Jason Turner's video C++ Weekly - Ep 112 - GCC's Leaky
>> > > > Abstractions shows
>> > > > two issues where g++ offers suggestions about implementation
>> > > > details:
>> > >
>> > >
>> > > > For the lambda capture case, there are multiple members:
>> > > >
>> > > > $9 = <function_decl 0x7ffff1a1dd00 __ct >
>> > >
>> > >
>> > > These names have a space at the end, so the user cannot name
>> > > them.  We could
>> > > move the space to the beginning, if that helps?
>> >
>> > I think compiler-generated entities that are not supposed to be
>> > user-visible should be DECL_ARTIFICIAL.
>>
>> Agreed, add_capture should set that flag on the FIELD_DECLs.
>
> I had tried flagging the lambda-captured vars as DECL_ARTIFICIAL,
> but it lead to a "too many initializers" error from reshape_init,
> so (before I saw your email), I tried the following approach: rather
> than looking at underscores, it uses is_lambda_ignored_entity (similar
> to qualify_lookup without LOOKUP_HIDDEN).
>
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
>
> Do you want me to do the DECL_ARTIFICAL approach, or is this OK?

This is OK.


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