[PATCH] CodeGen: __uuidof should work even with an incomplete _GUID type
Reid Kleckner
rnk at google.com
Tue Aug 13 13:24:54 PDT 2013
================
Comment at: test/CodeGenCXX/microsoft-uuidof.cpp:8
@@ +7,3 @@
+#ifdef WRONG_GUID
+ unsigned int SomethingWentWrong[4];
+#else
----------------
I was expecting a diagnostic. :)
Previously clang would reject this code:
struct __declspec(uuid("12345678-1234-1234-1234-1234567890aB")) S { };
typedef struct _GUID { int x; int y; } GUID;
GUID g = __uuidof(S);
cl.exe accepts and only copies the first 8 bytes, but I'd like to preserve the original clang behavior. Can we at least check that the sizeof() the user's type is 16?
http://llvm-reviews.chandlerc.com/D1375
More information about the cfe-commits
mailing list