This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Inline even functions containing static variables (take 2)
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [C++ PATCH] Inline even functions containing static variables (take 2)
- From: Jason Merrill <jason at redhat dot com>
- Date: 20 Mar 2001 16:46:07 +0000
- Cc: mark at codesourcery dot com, gcc-patches at gcc dot gnu dot org
- References: <20010320164828.C1635@sunsite.ms.mff.cuni.cz>
>>>>> "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