diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2013-07-22 16:02:19 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2013-07-22 16:02:19 +0000 |
| commit | 75eff74803140f4e0d8713b7d55f8da70472b10b (patch) | |
| tree | fd012f65e854909f272a29cdf60f706b3d4a3510 /libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp | |
| parent | 087f926a241bd70b16e47cd061a555d6add8d1ce (diff) | |
| download | bcm5719-llvm-75eff74803140f4e0d8713b7d55f8da70472b10b.tar.gz bcm5719-llvm-75eff74803140f4e0d8713b7d55f8da70472b10b.zip | |
Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug #16599. Thanks to Howard for the review and updates.
llvm-svn: 186834
Diffstat (limited to 'libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp')
| -rw-r--r-- | libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp index 03a00aef949..0ba898d98d8 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.elem/get_const.pass.cpp @@ -19,6 +19,8 @@ #include <string> #include <cassert> +struct Empty {}; + int main() { { @@ -32,6 +34,19 @@ int main() assert(std::get<0>(t) == "high"); assert(std::get<1>(t) == 5); } +#if _LIBCPP_STD_VER > 11 + { + typedef std::tuple<double, int> T; + constexpr T t(2.718, 5); + static_assert(std::get<0>(t) == 2.718, ""); + static_assert(std::get<1>(t) == 5, ""); + } + { + typedef std::tuple<Empty> T; + constexpr T t{Empty()}; + constexpr Empty e = std::get<0>(t); + } +#endif { typedef std::tuple<double&, std::string, int> T; double d = 1.5; |

