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

Jason Merrill jason@redhat.com
Tue Mar 20 08:47:00 GMT 2001


>>>>> "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



More information about the Gcc-patches mailing list