diff options
Diffstat (limited to 'clang/test/SemaCXX/member-pointer-ms.cpp')
-rw-r--r-- | clang/test/SemaCXX/member-pointer-ms.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/member-pointer-ms.cpp b/clang/test/SemaCXX/member-pointer-ms.cpp new file mode 100644 index 0000000..3b2d0fc --- /dev/null +++ b/clang/test/SemaCXX/member-pointer-ms.cpp @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -cxx-abi microsoft -fsyntax-only -verify %s + +// Test that we reject pointers to members of incomplete classes (for now) +struct A; //expected-note{{forward declaration of 'A'}} +int A::*pai1; //expected-error{{incomplete type 'A'}} + +// Test that we don't allow reinterpret_casts from pointers of one size to +// pointers of a different size. +struct A {}; +struct B {}; +struct C: A, B {}; + +void (A::*paf)(); +void (C::*pcf)() = reinterpret_cast<void (C::*)()>(paf); //expected-error{{cannot reinterpret_cast from member pointer type}} |