[PATCH] Unions with References

Aaron Ballman aaron at aaronballman.com
Thu May 30 06:36:08 PDT 2013


Microsoft has a language extension which allows union members to be
references.  What's more, they use this language extension in their
ATL header files (which come as part of MFC and the Win32 SDK).
Basically, they have code like this:

struct s {
  union {
     foo *fp;
     foo &fr;
    };

    s( foo &f ) : fr( f ) {}
    s( foo *f ) : fp( f ) {}
};

This patch enables support for union members to be references when
compiling with Microsoft extensions, and addresses PR13737.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: union.patch
Type: application/octet-stream
Size: 2142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130530/c5b32fad/attachment.obj>


More information about the cfe-commits mailing list