<div>Here is my plan on how to implement the __uuidof operator.</div><div>doc: <a href="http://msdn.microsoft.com/en-us/library/zaah6a61(v=VS.90).aspx">http://msdn.microsoft.com/en-us/library/zaah6a61(v=VS.90).aspx</a></div>
<div><br></div><div><br></div><div>For each class with an uuid attribute, clang would insert an implicit declaration of type: VarDecl.</div><div><br></div><div>For example: </div><div><br></div><div><div>  struct __declspec(uuid("00000000-0000-0000-0000-000000000001"))</div>
<div>  type_uuid { };</div></div><div><br></div><div>will add an implicit VarDecl looking like this:</div><div>  _GUID  implicit_no_name = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 1} };</div><div><br></div><div><br></div><div>A _GUID structure looks like this:</div>
<div><br></div><div><div>struct _GUID {</div><div>    unsigned long  Data1;</div><div>    unsigned short Data2;</div><div>    unsigned short Data3;</div><div>    unsigned char  Data4[ 8 ];</div><div>};</div></div><div><br>
</div><div>A pointer to the implicit VarDecl object will be saved in the UuidAttr class for later retrieval.</div><div>__uuidof will return a const reference to that VarDecl object.</div><div><br></div><div> </div><div>Also, given this code:</div>
<div><div>template <const _GUID*> class T {};</div></div><div>T<&__uuidof(var)> foo;</div><div><br></div><div>The function CheckTemplateArgumentAddressOfObjectOrFunction will need to be modified to accept an expression of type CXXUuidofExpr as "ArgIn"</div>
<div><br></div><div>All this only under -fms-extensions of course...</div><div>Any comments or potential problems with this approach?</div><div><br></div><div><br></div>