derive_from.pass.cpp 769 B

1234567891011121314151617181920212223242526272829
  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. // UNSUPPORTED: c++98, c++03
  10. // REQUIRES-ANY: c++11, c++14
  11. // <functional>
  12. // See https://llvm.org/bugs/show_bug.cgi?id=20002
  13. #include <functional>
  14. #include <type_traits>
  15. #include "test_macros.h"
  16. using Fn = std::function<void()>;
  17. struct S : public std::function<void()> { using function::function; };
  18. int main() {
  19. S s( [](){} );
  20. S f1( s );
  21. S f2(std::allocator_arg, std::allocator<int>{}, s);
  22. }