From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../func.wrap.func.nullptr/operator_==.pass.cpp | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp (limited to 'test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp') diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp new file mode 100644 index 000000000000..5bca0968702c --- /dev/null +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp @@ -0,0 +1,41 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// class function + +// template +// bool operator==(const function&, nullptr_t); +// +// template +// bool operator==(nullptr_t, const function&); +// +// template +// bool operator!=(const function&, nullptr_t); +// +// template +// bool operator!=(nullptr_t, const function&); + +#include +#include + +int g(int) {return 0;} + +int main() +{ + { + std::function f; + assert(f == nullptr); + assert(nullptr == f); + f = g; + assert(f != nullptr); + assert(nullptr != f); + } +} -- cgit v1.3