summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-05-10 00:08:32 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-05-10 00:08:32 +0000
commit2f019ed2e6222d4201f032ec8d1b7c9fcea96464 (patch)
tree1b1e07b8cc97142f6c65eefcf4a0344a0d1237ce /clang/test/Parser/MicrosoftExtensions.cpp
parent3fd06f760b196b76ac77d4c34bad83d78acdc5dc (diff)
downloadbcm5719-llvm-2f019ed2e6222d4201f032ec8d1b7c9fcea96464.tar.gz
bcm5719-llvm-2f019ed2e6222d4201f032ec8d1b7c9fcea96464.zip
Add a __uuidof test where the uuid attribute is on the second declaration.
Also some -fdelayed-template-parsing test refactoring. llvm-svn: 131113
Diffstat (limited to 'clang/test/Parser/MicrosoftExtensions.cpp')
-rw-r--r--clang/test/Parser/MicrosoftExtensions.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp
index 89b53e4912a..f441a5705c0 100644
--- a/clang/test/Parser/MicrosoftExtensions.cpp
+++ b/clang/test/Parser/MicrosoftExtensions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions
+// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions -fdelayed-template-parsing
/* Microsoft attribute tests */
[repeatable][source_annotation_attribute( Parameter|ReturnValue )]
@@ -105,6 +105,13 @@ template <class T, const GUID& g>
class COM_CLASS_TEMPLATE_REF { };
typedef COM_CLASS_TEMPLATE<struct_with_uuid, __uuidof(struct_with_uuid)> COM_TYPE_REF;
+ struct late_defined_uuid;
+ template<typename T>
+ void test_late_defined_uuid() {
+ __uuidof(late_defined_uuid);
+ }
+ struct __declspec(uuid("000000A0-0000-0000-C000-000000000049")) late_defined_uuid;
+
class CtorCall {
public:
@@ -136,7 +143,7 @@ class C2 {
};
template <class T>
-void f(){
+void missing_template_keyword(){
typename C1<T>:: /*template*/ Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}}
}
@@ -151,11 +158,6 @@ void redundant_typename() {
t = 3;
}
-int main() {
- redundant_typename<int>();
- f<int>();
-}
-
__interface MicrosoftInterface;
__interface MicrosoftInterface {
@@ -210,3 +212,11 @@ __if_not_exists(IF_EXISTS::Type_not) {
int __identifier(generic) = 3;
+
+int main () {
+ // Necessary to force instantiation in -fdelayed-template-parsing mode.
+ test_late_defined_uuid<int>();
+ redundant_typename<int>();
+ missing_template_keyword<int>();
+}
+
OpenPOWER on IntegriCloud