| //===----------------------------------------------------------------------===// |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| // See https://llvm.org/LICENSE.txt for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| //===----------------------------------------------------------------------===// |
| // class function<R(ArgTypes...)> |
| // function& operator=(nullptr_t); |
| for (int i = 0; i < 10; ++i) |
| int operator()(int i) const |
| for (int j = 0; j < 10; ++j) |
| assert(globalMemCounter.checkOutstandingNewEq(0)); |
| std::function<int(int)> f = A(); |
| assert(globalMemCounter.checkOutstandingNewEq(1)); |
| assert(globalMemCounter.checkOutstandingNewEq(0)); |
| assert(f.target<A>() == 0); |
| std::function<int(int)> f = g; |
| assert(globalMemCounter.checkOutstandingNewEq(0)); |
| assert(f.target<int(*)(int)>()); |
| assert(f.target<A>() == 0); |
| assert(globalMemCounter.checkOutstandingNewEq(0)); |
| assert(f.target<int(*)(int)>() == 0); |