Eric Fiselier | 8d5cbd7 | 2016-04-20 00:14:32 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // UNSUPPORTED: c++98, c++03 |
| 11 | |
| 12 | // <functional> |
| 13 | |
| 14 | // template<CopyConstructible Fn, CopyConstructible... Types> |
| 15 | // unspecified bind(Fn, Types...); |
| 16 | // template<Returnable R, CopyConstructible Fn, CopyConstructible... Types> |
| 17 | // unspecified bind(Fn, Types...); |
| 18 | |
| 19 | // https://llvm.org/bugs/show_bug.cgi?id=23141 |
| 20 | #include <functional> |
| 21 | #include <type_traits> |
| 22 | |
| 23 | struct Fun |
| 24 | { |
| 25 | template<typename T, typename U> |
Eric Fiselier | bda804e | 2016-04-28 03:17:56 +0000 | [diff] [blame] | 26 | void operator()(T &&, U &&) const |
Eric Fiselier | 8d5cbd7 | 2016-04-20 00:14:32 +0000 | [diff] [blame] | 27 | { |
| 28 | static_assert(std::is_same<U, int &>::value, ""); |
| 29 | } |
| 30 | }; |
| 31 | |
| 32 | int main() |
| 33 | { |
| 34 | std::bind(Fun{}, std::placeholders::_1, 42)("hello"); |
| 35 | } |