[cfe-dev] __uuidof and template arguments

David Majnemer david.majnemer at gmail.com
Sun Aug 18 01:45:42 PDT 2013


Hello all,

It seems like our __uuidof implementation has some interesting quirks.

We currently allow:
struct __declspec(uuid("{12345678-1234-1234-1234-1234567890ab}")) uuid;

struct _GUID;
template <float *>
struct thing {};

thing<__uuidof(uuid)> x;


__uuidof is treated as a bit of a celebrity in some areas in clang and I
believe it's special treatment makes it easier for gaps like these to show
up.

I don't know what's the best thing to do here but I see two obvious choices:
1. We continue treating __uuidof as a special thing,
making CheckTemplateArgumentAddressOfObjectOrFunction smarter, etc.
2. We change the way we semantically model the keyword/operator so that
instead of a specially handled operand, we have a DeclRefExpr like
CheckTemplateArgumentAddressOfObjectOrFunction would normally expect.

Thanks
-- 
David Majnemer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130818/e34f755c/attachment.html>


More information about the cfe-dev mailing list