summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2010-12-27 01:32:00 +0000
committerFrancois Pichet <pichet2000@gmail.com>2010-12-27 01:32:00 +0000
commitb7577657cdf30199a091d3f71d63ff9ab25846f0 (patch)
tree0b248aedbb3409f249ae8a2a160c468e81bfb0b6 /clang/test
parent2ac8355ecd187bcf86aeae9ae0c8a92b37daf8b1 (diff)
downloadbcm5719-llvm-b7577657cdf30199a091d3f71d63ff9ab25846f0.tar.gz
bcm5719-llvm-b7577657cdf30199a091d3f71d63ff9ab25846f0.zip
More __uuidof validation:
1. Do not validate for uuid attribute if the type is template dependent. 2. Search every class declaration and definition for the uuid attribute. llvm-svn: 122578
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/MicrosoftExtensions.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp
index ef4a3f6d784..bc8e88d64bb 100644
--- a/clang/test/Parser/MicrosoftExtensions.cpp
+++ b/clang/test/Parser/MicrosoftExtensions.cpp
@@ -48,6 +48,11 @@ struct __declspec(uuid("000000A0-0000-0000-C000-000000000046"))
struct_with_uuid { };
struct struct_without_uuid { };
+struct __declspec(uuid("000000A0-0000-0000-C000-000000000049"))
+struct_with_uuid2;
+
+struct
+struct_with_uuid2 {} ;
int uuid_sema_test()
{
@@ -55,6 +60,7 @@ int uuid_sema_test()
struct_without_uuid var_without_uuid[1];
__uuidof(struct_with_uuid);
+ __uuidof(struct_with_uuid2);
__uuidof(struct_without_uuid); // expected-error {{cannot call operator __uuidof on a type with no GUID}}
__uuidof(struct_with_uuid*);
__uuidof(struct_without_uuid*); // expected-error {{cannot call operator __uuidof on a type with no GUID}}
@@ -69,3 +75,13 @@ int uuid_sema_test()
__uuidof(0);
__uuidof(1);// expected-error {{cannot call operator __uuidof on a type with no GUID}}
}
+
+
+template <class T>
+void template_uuid()
+{
+ T expr;
+
+ __uuidof(T);
+ __uuidof(expr);
+}
OpenPOWER on IntegriCloud