From: Francois Pichet Date: Tue, 10 May 2011 00:08:32 +0000 (+0000) Subject: Add a __uuidof test where the uuid attribute is on the second declaration. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=20e3c9ed21b47c3b6d1d82df84db357600bacc06;p=clang 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 --- 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 COM_CLASS_TEMPLATE_REF { }; typedef COM_CLASS_TEMPLATE COM_TYPE_REF; + struct late_defined_uuid; + template + 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 -void f(){ +void missing_template_keyword(){ typename C1:: /*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(); - f(); -} - __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(); + redundant_typename(); + missing_template_keyword(); +} +