On Thu, Apr 26, 2018 at 8:09 PM, David Malcolm <dmalc...@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.guent...@gmail.com> wrote: >> > On Wed, Apr 25, 2018 at 7:10 PM, Nathan Sidwell <nat...@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.