diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-05-10 00:08:32 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-05-10 00:08:32 +0000 |
commit | 20e3c9ed21b47c3b6d1d82df84db357600bacc06 (patch) | |
tree | 7384f22df67691b38fe66ee9e9910400b3948a46 | |
parent | 7604f64a865bdba86c05cab76bcd47fd10372eb8 (diff) |
Add a __uuidof test where the uuid attribute is on the second declaration.
Also some -fdelayed-template-parsing test refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131113 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Parser/MicrosoftExtensions.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp index 89b53e4912..f441a5705c 100644 --- a/test/Parser/MicrosoftExtensions.cpp +++ b/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>(); +} + |