diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/calling-conv-compat.cpp | 19 | ||||
-rw-r--r-- | clang/test/SemaCXX/decl-microsoft-call-conv.cpp | 12 |
2 files changed, 22 insertions, 9 deletions
diff --git a/clang/test/SemaCXX/calling-conv-compat.cpp b/clang/test/SemaCXX/calling-conv-compat.cpp index 2d52386add1..c55124c5805 100644 --- a/clang/test/SemaCXX/calling-conv-compat.cpp +++ b/clang/test/SemaCXX/calling-conv-compat.cpp @@ -351,24 +351,25 @@ typedef void (__cdecl fun_cdecl)(); typedef void (__stdcall fun_stdcall)(); typedef void (__fastcall fun_fastcall)(); -// FIXME: Adjust cdecl to thiscall when forming a member pointer. -//fun_default A::*td1 = &A::method_thiscall; -fun_cdecl A::*td2 = &A::method_cdecl; +fun_default A::*td1 = &A::method_thiscall; +fun_cdecl A::*td2 = &A::method_thiscall; fun_stdcall A::*td3 = &A::method_stdcall; fun_fastcall A::*td4 = &A::method_fastcall; // Round trip the function type through a template, and verify that only cdecl // gets adjusted. -template<typename Fn> struct X { - typedef Fn A::*p; -}; +template<typename Fn> struct X { typedef Fn A::*p; }; -// FIXME: Adjust cdecl to thiscall when forming a member pointer. -//X<void ()>::p tmpl1 = &A::method_thiscall; -//X<void __cdecl ()>::p tmpl2 = &A::method_thiscall; +X<void ()>::p tmpl1 = &A::method_thiscall; +X<void __cdecl ()>::p tmpl2 = &A::method_thiscall; X<void __stdcall ()>::p tmpl3 = &A::method_stdcall; X<void __fastcall ()>::p tmpl4 = &A::method_fastcall; +X<fun_default >::p tmpl5 = &A::method_thiscall; +X<fun_cdecl >::p tmpl6 = &A::method_thiscall; +X<fun_stdcall >::p tmpl7 = &A::method_stdcall; +X<fun_fastcall>::p tmpl8 = &A::method_fastcall; + } // end namespace MemberPointers // Test that lambdas that capture nothing convert to cdecl function pointers. diff --git a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp index 9f1463245ba..fd20ae234ec 100644 --- a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp +++ b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp @@ -191,3 +191,15 @@ namespace test5 { }; extern template void valarray<int>::bar(); } + +namespace test6 { + struct foo { + int bar(); + }; + typedef int bar_t(); + void zed(bar_t foo::*) { + } + void baz() { + zed(&foo::bar); + } +} |