diff --git a/include/experimental/functional b/include/experimental/functional new file mode 100644 index 00000000..f5a905f2 --- /dev/null +++ b/include/experimental/functional @@ -0,0 +1,133 @@ +// -*- C++ -*- +//===-------------------------- functional --------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_EXPERIMENTAL_FUNCTIONAL +#define _LIBCPP_EXPERIMENTAL_FUNCTIONAL + +/* + experimental/functional synopsis + +#include + +namespace std { +namespace experimental { +inline namespace fundamentals_v1 { + + // See C++14 ยง20.9.9, Function object binders + template constexpr bool is_bind_expression_v + = is_bind_expression::value; + template constexpr int is_placeholder_v + = is_placeholder::value; + + // 4.2, Class template function + template class function; // undefined + template class function; + + template + void swap(function&, function&); + + template + bool operator==(const function&, nullptr_t) noexcept; + template + bool operator==(nullptr_t, const function&) noexcept; + template + bool operator!=(const function&, nullptr_t) noexcept; + template + bool operator!=(nullptr_t, const function&) noexcept; + + // 4.3, Searchers + template> + class default_searcher; + + template::value_type>, + class BinaryPredicate = equal_to<>> + class boyer_moore_searcher; + + template::value_type>, + class BinaryPredicate = equal_to<>> + class boyer_moore_horspool_searcher; + + template> + default_searcher + make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last, + BinaryPredicate pred = BinaryPredicate()); + + template::value_type>, + class BinaryPredicate = equal_to<>> + boyer_moore_searcher + make_boyer_moore_searcher( + RandomAccessIterator pat_first, RandomAccessIterator pat_last, + Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); + + template::value_type>, + class BinaryPredicate = equal_to<>> + boyer_moore_horspool_searcher + make_boyer_moore_horspool_searcher( + RandomAccessIterator pat_first, RandomAccessIterator pat_last, + Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); + + } // namespace fundamentals_v1 + } // namespace experimental + + template + struct uses_allocator, Alloc>; + +} // namespace std + +*/ + +#include +#include +#include + +#include <__undef_min_max> + +#include <__debug> + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +_LIBCPP_BEGIN_NAMESPACE_LFTS + +// default searcher +template> +class default_searcher { +public: + default_searcher(_ForwardIterator __f, _ForwardIterator __l, + _BinaryPredicate __p = _BinaryPredicate()) + : __first_(__f), __last_(__l), __pred_(__p) {} + + template + _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { + return _VSTD::search(__f, __l, __first_, __last_, __pred_); + } + +private: + _ForwardIterator __first_; + _ForwardIterator __last_; + _BinaryPredicate __pred_; + }; + +template> +default_searcher<_ForwardIterator, _BinaryPredicate> +make_default_searcher( _ForwardIterator __f, _ForwardIterator __l, _BinaryPredicate __p = _BinaryPredicate ()) +{ + return default_searcher<_ForwardIterator, _BinaryPredicate>(__f, __l, __p); +} + + +_LIBCPP_END_NAMESPACE_LFTS + +#endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */ diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp new file mode 100644 index 00000000..4ae5cf7e --- /dev/null +++ b/test/std/experimental/func/func.searchers/func.searchers.default/default.pass.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// default searcher +// template> +// class default_searcher { +// public: +// default_searcher(_ForwardIterator __f, _ForwardIterator __l, +// _BinaryPredicate __p = _BinaryPredicate()) +// : __first_(__f), __last_(__l), __pred_(__p) {} +// +// template +// _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { +// return std::search(__f, __l, __first_, __last_, __pred_); +// } +// +// private: +// _ForwardIterator __first_; +// _ForwardIterator __last_; +// _BinaryPredicate __pred_; +// }; + + +#include +#include +#include + +#include "test_iterators.h" + +template +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) { + std::experimental::default_searcher s{b2, e2}; + assert(result == std::experimental::search(b1, e1, s)); +} + +template +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +int main() { + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); +} diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp new file mode 100644 index 00000000..a790f32c --- /dev/null +++ b/test/std/experimental/func/func.searchers/func.searchers.default/default.pred.pass.cpp @@ -0,0 +1,100 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// default searcher +// template> +// class default_searcher { +// public: +// default_searcher(_ForwardIterator __f, _ForwardIterator __l, +// _BinaryPredicate __p = _BinaryPredicate()) +// : __first_(__f), __last_(__l), __pred_(__p) {} +// +// template +// _ForwardIterator2 operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const { +// return std::search(__f, __l, __first_, __last_, __pred_); +// } +// +// private: +// _ForwardIterator __first_; +// _ForwardIterator __last_; +// _BinaryPredicate __pred_; +// }; + + +#include +#include +#include + +#include "test_iterators.h" + +struct count_equal +{ + static unsigned count; + template + bool operator()(const T& x, const T& y) + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + std::experimental::default_searcher s{b2, e2}; + count_equal::count = 0; + assert(result == std::experimental::search(b1, e1, s)); + assert(count_equal::count <= max_count); +} + +template +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); +} diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp new file mode 100644 index 00000000..de4cfcfd --- /dev/null +++ b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pass.cpp @@ -0,0 +1,79 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// template> +// default_searcher +// make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last, +// BinaryPredicate pred = BinaryPredicate()); + + +#include +#include +#include + +#include "test_iterators.h" + +template +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result) { + assert(result == std::experimental::search(b1, e1, + std::experimental::make_default_searcher(b2, e2))); +} + +template +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2)); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3)); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia)); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1)); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1)); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1)); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1)); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4)); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8)); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3)); + int ij[] = {0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sj = sizeof(ij)/sizeof(ij[0]); + int ik[] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0}; + const unsigned sk = sizeof(ik)/sizeof(ik[0]); + do_search(Iter1(ij), Iter1(ij+sj), Iter2(ik), Iter2(ik+sk), Iter1(ij+6)); +} + +int main() { + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); +} diff --git a/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp new file mode 100644 index 00000000..d8939c88 --- /dev/null +++ b/test/std/experimental/func/func.searchers/func.searchers.default/func.searchers.default.creation/make_default_searcher.pred.pass.cpp @@ -0,0 +1,86 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// template> +// default_searcher +// make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last, +// BinaryPredicate pred = BinaryPredicate()); + + +#include +#include +#include + +#include "test_iterators.h" + +struct count_equal +{ + static unsigned count; + template + bool operator()(const T& x, const T& y) + {++count; return x == y;} +}; + +unsigned count_equal::count = 0; + +template +void do_search(Iter1 b1, Iter1 e1, Iter2 b2, Iter2 e2, Iter1 result, unsigned max_count) { + count_equal::count = 0; + assert(result == std::experimental::search(b1, e1, + std::experimental::make_default_searcher(b2, e2))); + assert(count_equal::count <= max_count); +} + +template +void +test() +{ + int ia[] = {0, 1, 2, 3, 4, 5}; + const unsigned sa = sizeof(ia)/sizeof(ia[0]); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+1), Iter1(ia), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+1), Iter2(ia+2), Iter1(ia+1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+2), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+2), Iter2(ia+3), Iter1(ia+2), sa); + do_search(Iter1(ia), Iter1(ia), Iter2(ia+2), Iter2(ia+3), Iter1(ia), 0); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-1), Iter2(ia+sa), Iter1(ia+sa-1), sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia+sa-3), Iter2(ia+sa), Iter1(ia+sa-3), 3*sa); + do_search(Iter1(ia), Iter1(ia+sa), Iter2(ia), Iter2(ia+sa), Iter1(ia), sa*sa); + do_search(Iter1(ia), Iter1(ia+sa-1), Iter2(ia), Iter2(ia+sa), Iter1(ia+sa-1), (sa-1)*sa); + do_search(Iter1(ia), Iter1(ia+1), Iter2(ia), Iter2(ia+sa), Iter1(ia+1), sa); + int ib[] = {0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sb = sizeof(ib)/sizeof(ib[0]); + int ic[] = {1}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ic), Iter2(ic+1), Iter1(ib+1), sb); + int id[] = {1, 2}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(id), Iter2(id+2), Iter1(ib+1), sb*2); + int ie[] = {1, 2, 3}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ie), Iter2(ie+3), Iter1(ib+4), sb*3); + int ig[] = {1, 2, 3, 4}; + do_search(Iter1(ib), Iter1(ib+sb), Iter2(ig), Iter2(ig+4), Iter1(ib+8), sb*4); + int ih[] = {0, 1, 1, 1, 1, 2, 3, 0, 1, 2, 3, 4}; + const unsigned sh = sizeof(ih)/sizeof(ih[0]); + int ii[] = {1, 1, 2}; + do_search(Iter1(ih), Iter1(ih+sh), Iter2(ii), Iter2(ii+3), Iter1(ih+3), sh*3); +} + +int main() { + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); + test, forward_iterator >(); + test, bidirectional_iterator >(); + test, random_access_iterator >(); +} diff --git a/test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp b/test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp new file mode 100644 index 00000000..9a59227a --- /dev/null +++ b/test/std/experimental/func/func.searchers/nothing_to_do.pass.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} diff --git a/test/std/experimental/func/header.functional.synop/includes.pass.cpp b/test/std/experimental/func/header.functional.synop/includes.pass.cpp new file mode 100644 index 00000000..1b72d4a7 --- /dev/null +++ b/test/std/experimental/func/header.functional.synop/includes.pass.cpp @@ -0,0 +1,21 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03, c++11 + +// +// +// has to include + +#include + +int main() +{ + std::function x; +} diff --git a/test/std/experimental/func/nothing_to_do.pass.cpp b/test/std/experimental/func/nothing_to_do.pass.cpp new file mode 100644 index 00000000..9a59227a --- /dev/null +++ b/test/std/experimental/func/nothing_to_do.pass.cpp @@ -0,0 +1,13 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +int main() +{ +}