mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Guard libc++ specific tests SFINAE on std::bind's call operator. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@276576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
int dummy = 42;
|
int dummy = 42;
|
||||||
|
|
||||||
int return_value(int) { return dummy; }
|
int return_value(int) { return dummy; }
|
||||||
@@ -81,10 +83,10 @@ void do_test(Fn* func) {
|
|||||||
// Check that the call operator SFINAE's away when too few arguments
|
// Check that the call operator SFINAE's away when too few arguments
|
||||||
// are provided but is well-formed otherwise.
|
// are provided but is well-formed otherwise.
|
||||||
{
|
{
|
||||||
static_assert(!CheckCall<Bind>(), "");
|
LIBCPP_STATIC_ASSERT(!CheckCall<Bind>(), "");
|
||||||
static_assert(CheckCall<Bind, int>(), "");
|
static_assert(CheckCall<Bind, int>(), "");
|
||||||
static_assert(CheckCall<Bind, int, int>(), "");
|
static_assert(CheckCall<Bind, int, int>(), "");
|
||||||
static_assert(!CheckCall<BindR>(), "");
|
LIBCPP_STATIC_ASSERT(!CheckCall<BindR>(), "");
|
||||||
static_assert(CheckCall<BindR, int>(), "");
|
static_assert(CheckCall<BindR, int>(), "");
|
||||||
static_assert(CheckCall<BindR, int, int>(), "");
|
static_assert(CheckCall<BindR, int, int>(), "");
|
||||||
}
|
}
|
||||||
@@ -108,7 +110,7 @@ void do_test_r(Fn* func) {
|
|||||||
// Check that the call operator SFINAE's away when too few arguments
|
// Check that the call operator SFINAE's away when too few arguments
|
||||||
// are provided but is well-formed otherwise.
|
// are provided but is well-formed otherwise.
|
||||||
{
|
{
|
||||||
static_assert(!CheckCall<Bind>(), "");
|
LIBCPP_STATIC_ASSERT(!CheckCall<Bind>(), "");
|
||||||
static_assert(CheckCall<Bind, int>(), "");
|
static_assert(CheckCall<Bind, int>(), "");
|
||||||
static_assert(CheckCall<Bind, int, int>(), "");
|
static_assert(CheckCall<Bind, int, int>(), "");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user