diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-04-01 20:22:13 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-04-01 20:22:13 +0000 |
| commit | d2f6c726e77c2943f8723d0f9dd65f68b92ef0e0 (patch) | |
| tree | daf225448153dbc6d7cb5ebc9aadead62cdb55a7 /clang/test/SemaCXX/decl-microsoft-call-conv.cpp | |
| parent | 084c384c6f644ecf907fd208cd51cf30d67a5940 (diff) | |
| download | bcm5719-llvm-d2f6c726e77c2943f8723d0f9dd65f68b92ef0e0.tar.gz bcm5719-llvm-d2f6c726e77c2943f8723d0f9dd65f68b92ef0e0.zip | |
Re-land "MS ABI: lambda call operators are instance methods and should use thiscall"
Update the test cases to pass when lambda call operators use thiscall.
Update the lambda-to-block conversion operator to use the default free
function calling convention instead of the call operator's convention.
This reverts commit r233082 and re-instates r233023.
llvm-svn: 233835
Diffstat (limited to 'clang/test/SemaCXX/decl-microsoft-call-conv.cpp')
| -rw-r--r-- | clang/test/SemaCXX/decl-microsoft-call-conv.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp index a4b68cdbc7d..6c392ea9420 100644 --- a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp +++ b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -verify %s -// RUN: %clang_cc1 -triple i686-pc-mingw32 -verify %s -// RUN: %clang_cc1 -triple i686-pc-mingw32 -fms-extensions -verify %s +// RUN: %clang_cc1 -std=c++14 -triple i686-pc-win32 -fms-extensions -verify %s +// RUN: %clang_cc1 -std=c++14 -triple i686-pc-mingw32 -verify %s +// RUN: %clang_cc1 -std=c++14 -triple i686-pc-mingw32 -fms-extensions -verify %s typedef void void_fun_t(); typedef void __cdecl cdecl_fun_t(); @@ -242,3 +242,19 @@ namespace test8 { s.f(p); // expected-note {{in instantiation of member function 'test8::S<void *>::f' requested here}} } } + +namespace test9 { + // Used to fail when we forgot to make lambda call operators use __thiscall. + template <typename F> + decltype(auto) deduce(F f) { + return &decltype(f)::operator(); + } + template <typename C, typename R, typename A> + decltype(auto) signaturehelper(R (C::*f)(A) const) { + return R(); + } + void f() { + auto l = [](int x) { return x * 2; }; + decltype(signaturehelper(deduce(l))) p; + } +} |

