diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-12-02 23:00:05 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-12-02 23:00:05 +0000 |
commit | 0d3d8de014f1012dd0b2c2c077099cf6face44e5 (patch) | |
tree | 393c7c9e6470ac1076fd1d504275a9da84dda05d /libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp | |
parent | 1882002c91fe37fa76d7379697cee4275a5bcc3a (diff) | |
download | bcm5719-llvm-0d3d8de014f1012dd0b2c2c077099cf6face44e5.tar.gz bcm5719-llvm-0d3d8de014f1012dd0b2c2c077099cf6face44e5.zip |
Implement C++17 <variant>. Patch from Michael Park!
This patch was reviewed as https://reviews.llvm.org/D23263.
llvm-svn: 288547
Diffstat (limited to 'libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp index 2a87f32ef9a..66f67fe8d3f 100644 --- a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp +++ b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp @@ -28,20 +28,20 @@ struct ThrowsMove { }; struct NoCopy { - NoCopy(NoCopy const &) = delete; + NoCopy(const NoCopy &) = delete; }; struct MoveOnly { int value; MoveOnly(int v) : value(v) {} - MoveOnly(MoveOnly const &) = delete; + MoveOnly(const MoveOnly &) = delete; MoveOnly(MoveOnly &&) = default; }; struct MoveOnlyNT { int value; MoveOnlyNT(int v) : value(v) {} - MoveOnlyNT(MoveOnlyNT const &) = delete; + MoveOnlyNT(const MoveOnlyNT &) = delete; MoveOnlyNT(MoveOnlyNT &&other) : value(other.value) { other.value = -1; } }; @@ -49,13 +49,13 @@ struct MoveOnlyNT { struct MakeEmptyT { static int alive; MakeEmptyT() { ++alive; } - MakeEmptyT(MakeEmptyT const &) { + MakeEmptyT(const MakeEmptyT &) { ++alive; // Don't throw from the copy constructor since variant's assignment // operator performs a copy before committing to the assignment. } MakeEmptyT(MakeEmptyT &&) { throw 42; } - MakeEmptyT &operator=(MakeEmptyT const &) { throw 42; } + MakeEmptyT &operator=(const MakeEmptyT &) { throw 42; } MakeEmptyT &operator=(MakeEmptyT &&) { throw 42; } ~MakeEmptyT() { --alive; } }; |