tuple.smartptr.pass.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. // Tuples of smart pointers; based on bug #18350
  12. // auto_ptr doesn't have a copy constructor that takes a const &, but tuple does.
  13. #include <tuple>
  14. #include <memory>
  15. int main () {
  16. {
  17. std::tuple<std::unique_ptr<char>> up;
  18. std::tuple<std::shared_ptr<char>> sp;
  19. std::tuple<std::weak_ptr <char>> wp;
  20. }
  21. {
  22. std::tuple<std::unique_ptr<char[]>> up;
  23. std::tuple<std::shared_ptr<char[]>> sp;
  24. std::tuple<std::weak_ptr <char[]>> wp;
  25. }
  26. // Smart pointers of type 'T[N]' are not tested here since they are not
  27. // supported by the standard nor by libc++'s implementation.
  28. // See https://reviews.llvm.org/D21320 for more information.
  29. }