alloc_convert_move.fail.cpp 943 B

123456789101112131415161718192021222324252627282930313233343536
  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. // <tuple>
  10. // template <class... Types> class tuple;
  11. // template <class Alloc, class ...UTypes>
  12. // tuple(allocator_arg_t, const Alloc& a, tuple<UTypes...>&&);
  13. // UNSUPPORTED: c++98, c++03
  14. #include <tuple>
  15. #include <memory>
  16. struct ExplicitCopy {
  17. explicit ExplicitCopy(int) {}
  18. explicit ExplicitCopy(ExplicitCopy const&) {}
  19. };
  20. std::tuple<ExplicitCopy> explicit_move_test() {
  21. std::tuple<int> t1(42);
  22. return {std::allocator_arg, std::allocator<void>{}, std::move(t1)};
  23. // expected-error@-1 {{chosen constructor is explicit in copy-initialization}}
  24. }
  25. int main()
  26. {
  27. }