This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48323] [4.5/4.6/4.7 Regression] Lifetime of local variables: global versus member function
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Mar 2011 22:25:19 +0000
- Subject: [Bug middle-end/48323] [4.5/4.6/4.7 Regression] Lifetime of local variables: global versus member function
- Auto-submitted: auto-generated
- References: <bug-48323-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48323
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-03-28 22:25:00 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> Sorry for being pedantic, but would you care to explain how your observation
> renders this report invalid? I am afraid I do not understand this resolution.
>
> Do you assert that the two cases (static local in global vs. class scope
> function) are deliberately treated differently? If so, is this an
> implementation choice, or is it based on a document that I should have read
> (which one)?
Yes they are different because C::class_scope_f is a vague linkage while
global_f is global linkage. So the i in each one is of different linkage. If
you want C type to be local to the shared, then you need to use either the
hidden attribute on it or use -fvisibility=hidden.