[cfe-commits] r153723 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp lib/CodeGen/ItaniumCXXABI.cpp test/CodeGenCXX/static-init.cpp

John McCall rjmccall at apple.com
Fri Mar 30 00:13:55 PDT 2012


On Mar 29, 2012, at 10:13 PM, Eli Friedman wrote:
> On Thu, Mar 29, 2012 at 9:46 PM, John McCall <rjmccall at apple.com> 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.



More information about the cfe-commits mailing list