diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /test/SemaCXX/MicrosoftExtensions.cpp | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'test/SemaCXX/MicrosoftExtensions.cpp')
-rw-r--r-- | test/SemaCXX/MicrosoftExtensions.cpp | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/test/SemaCXX/MicrosoftExtensions.cpp b/test/SemaCXX/MicrosoftExtensions.cpp index 2d620b6..9b03feb 100644 --- a/test/SemaCXX/MicrosoftExtensions.cpp +++ b/test/SemaCXX/MicrosoftExtensions.cpp @@ -6,6 +6,8 @@ void f(const type_info &a); // Microsoft doesn't validate exception specification. +namespace microsoft_exception_spec { + void foo(); // expected-note {{previous declaration}} void foo() throw(); // expected-warning {{exception specification in declaration does not match previous declaration}} @@ -22,6 +24,15 @@ struct Derived : Base { virtual void f3(); }; +class A { + virtual ~A() throw(); // expected-note {{overridden virtual function is here}} +}; + +class B : public A { + virtual ~B(); // expected-warning {{exception specification of overriding function is more lax than base version}} +}; + +} // MSVC allows type definition in anonymous union and struct struct A @@ -179,4 +190,65 @@ void static_func(); // expected-note {{previous declaration is here}} static void static_func() // expected-warning {{static declaration of 'static_func' follows non-static declaration}} { -}
\ No newline at end of file +} + +long function_prototype(int a); +long (*function_ptr)(int a); + +void function_to_voidptr_conv() { + void *a1 = function_prototype; + void *a2 = &function_prototype; + void *a3 = function_ptr; +} + + +void pointer_to_integral_type_conv(char* ptr) { + char ch = (char)ptr; + short sh = (short)ptr; + ch = (char)ptr; + sh = (short)ptr; +} + +namespace ms_using_declaration_bug { + +class A { +public: + int f(); +}; + +class B : public A { +private: + using A::f; +}; + +class C : public B { +private: + using B::f; // expected-warning {{using declaration refers to inaccessible member 'ms_using_declaration_bug::B::f', which refers to accessible member 'ms_using_declaration_bug::A::f', accepted for Microsoft compatibility}} +}; + +} + + + +namespace friend_as_a_forward_decl { + +class A { + class Nested { + friend class B; + B* b; + }; + B* b; +}; +B* global_b; + + +void f() +{ + class Local { + friend class Z; + Z* b; + }; + Z* b; +} + + }
\ No newline at end of file |