Repro looks like this:
extern "C" {
void f() { static int n = 1; }
void g() { static long long n = 2; }
}
The root cause seems to be that we don't mangle static locals inside an
extern "C" block. (For reference, g++ does.)
On Fri, Mar 30, 2012 at 12:13 AM, John McCall <[email protected]> wrote:
> On Mar 29, 2012, at 10:13 PM, Eli Friedman wrote:
> > On Thu, Mar 29, 2012 at 9:46 PM, John McCall <[email protected]> wrote:
> >> On Mar 29, 2012, at 9:41 PM, Eli Friedman wrote:
> >>> This check won't work reliably: the global's type isn't guaranteed to
> >>> be the same as the IR type of the variable.
> >>
> >> Is there a situation you have in mind where the type check I've got
> would
> >> be inadequate?
> >
> > B::B() {
> > union U { void* x; long double y; };
> > static U u = { (void*)&u };
> > }
>
> Right you are. r153733 tries to keep some of the value of the check
> while still handling this.
>
> John.
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits