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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122578 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp
index ef4a3f6..bc8e88d 100644
--- a/test/Parser/MicrosoftExtensions.cpp
+++ b/test/Parser/MicrosoftExtensions.cpp
@@ -48,6 +48,11 @@
 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 @@
    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 @@
    __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);
+}