aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-04-28 04:39:50 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-04-28 04:39:50 +0000
commita97d24f2ca50f318f62a6cf2a621e7842dd63b4a (patch)
tree6760254c417081d5c0e4ca85749e8a8131a94531 /test/Parser/MicrosoftExtensions.cpp
parent457aaf0692dfb2d9638f383334b81027f637f20c (diff)
Support &__uuidof(type) as a non type template argument.
This idiom is used everywhere in MFC/COM code and as such this patch removes hundreds of errors when parsing MFC code with clang. Example: template <class T, const GUID* g = &__uuidof(T)> class ComTemplate { }; typedef ComTemplate<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE; Of course this is just parsing support. Trying to use this in CodeGen will generate: error: cannot yet mangle expression type CXXUuidofExpr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/MicrosoftExtensions.cpp')
-rw-r--r--test/Parser/MicrosoftExtensions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp
index a5d2d513b1..decd57510f 100644
--- a/test/Parser/MicrosoftExtensions.cpp
+++ b/test/Parser/MicrosoftExtensions.cpp
@@ -95,6 +95,13 @@ void template_uuid()
}
+template <class T, const GUID* g = &__uuidof(T)>
+class COM_CLASS_TEMPLATE { };
+
+typedef COM_CLASS_TEMPLATE<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE_1;
+typedef COM_CLASS_TEMPLATE<struct_with_uuid> COM_TYPE_2;
+
+
class CtorCall {
public: