diff options
author | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-05-02 19:39:53 +0000 |
commit | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (patch) | |
tree | 64a10f4c4154739d4a8191d7e1b52ce497f4ebd6 /test/Parser/MicrosoftExtensions.cpp | |
parent | a0fb00f9837bd0d2e5948f16f6a6b82a7a628f51 (diff) | |
download | FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.zip FreeBSD-src-110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab.tar.gz |
Vendor import of clang trunk r130700:
http://llvm.org/svn/llvm-project/cfe/trunk@130700
Diffstat (limited to 'test/Parser/MicrosoftExtensions.cpp')
-rw-r--r-- | test/Parser/MicrosoftExtensions.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp index fd0d7d5..32ed375 100644 --- a/test/Parser/MicrosoftExtensions.cpp +++ b/test/Parser/MicrosoftExtensions.cpp @@ -95,6 +95,16 @@ void template_uuid() } +template <class T, const GUID* g = &__uuidof(T)> +class COM_CLASS_TEMPLATE { }; + +typedef COM_CLASS_TEMPLATE<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE_1; +typedef COM_CLASS_TEMPLATE<struct_with_uuid> COM_TYPE_2; + +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; + class CtorCall { public: @@ -111,3 +121,46 @@ CtorCall& CtorCall::operator=(const CtorCall& that) } return *this; } + +template <class A> +class C1 { +public: + template <int B> + class Iterator { + }; +}; + +template<class T> +class C2 { + typename C1<T>:: /*template*/ Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}} +}; + +template <class T> +void f(){ + typename C1<T>:: /*template*/ Iterator<0> Mypos; // expected-warning {{use 'template' keyword to treat 'Iterator' as a dependent template name}} +} + + + +class AAAA { }; + +template <class T> +void redundant_typename() { + typename T t;// expected-warning {{expected a qualified name after 'typename'}} + typename AAAA a;// expected-warning {{expected a qualified name after 'typename'}} + t = 3; +} + +int main() { + redundant_typename<int>(); + f<int>(); +} + + +__interface MicrosoftInterface; +__interface MicrosoftInterface { + virtual void foo1() = 0; + virtual void foo2() = 0; +}; + +__int64 x7 = __int64(0); |