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]

Re: [C++ PATCH] Inline even functions containing static variables (take 2)


>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:

> Here is a second attempt against today's trunk. I tried to incorporate
> feedback into it.

Great.

> Discriminator for VAR_DECLs is now stored in lang_decl_flag's (instead of
> DECL_ACCESS)

But VAR_DECLs can have DECL_ACCESS, too: think static data members.

> expand_static_init call has been moved from grok_reference_init to
> cp_finish_decl (ie. after maybe_commonize_var).

Thanks, but this still isn't quite right.  We want to obscure a
non-constant initializer before we get to maybe_commonize_var, just as we
do for non-reference decls.  Basically, grok_reference_init should return
like store_init_value, and check_initializer should do the same thing with
the result.

Also, please extend this to handle local classes properly.  And remember
that we will eventually want to handle string constants the same way.

Thanks,
Jason


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