diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2012-04-02 21:00:45 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2012-04-02 21:00:45 +0000 |
| commit | e386b7b360d6508f974db64d43d13129e36e2b22 (patch) | |
| tree | c3d32fbea80d078764ae59bcd575ab7179aa061d /libcxx/test | |
| parent | 9b7efd5bb617fae759c9ebe7fb4f72c989027fd8 (diff) | |
| download | bcm5719-llvm-e386b7b360d6508f974db64d43d13129e36e2b22.tar.gz bcm5719-llvm-e386b7b360d6508f974db64d43d13129e36e2b22.zip | |
Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
llvm-svn: 153896
Diffstat (limited to 'libcxx/test')
4 files changed, 20 insertions, 12 deletions
diff --git a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp index cac823aaf8f..1c2b2a80c59 100644 --- a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp +++ b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/eval.pass.cpp @@ -30,12 +30,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: - // Temporary work around for lack of constexpr +#ifdef _LIBCPP_HAS_NO_CONSTEXPR + // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; +#endif - static const/*expr*/ result_type min() {return Min;} - static const/*expr*/ result_type max() {return Max;} + static _LIBCPP_CONSTEXPR result_type min() {return Min;} + static _LIBCPP_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { diff --git a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp index b1fcabae6e1..78040ad987d 100644 --- a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp +++ b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.ibits/result_type.pass.cpp @@ -32,12 +32,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: - // Temporary work around for lack of constexpr +#ifdef _LIBCPP_HAS_NO_CONSTEXPR + // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; +#endif - static const/*expr*/ result_type min() {return Min;} - static const/*expr*/ result_type max() {return Max;} + static _LIBCPP_CONSTEXPR result_type min() {return Min;} + static _LIBCPP_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { diff --git a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp index 20a20445217..c218c17dde6 100644 --- a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp +++ b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/eval.pass.cpp @@ -30,12 +30,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: - // Temporary work around for lack of constexpr +#ifdef _LIBCPP_HAS_NO_CONSTEXPR + // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; +#endif - static const/*expr*/ result_type min() {return Min;} - static const/*expr*/ result_type max() {return Max;} + static _LIBCPP_CONSTEXPR result_type min() {return Min;} + static _LIBCPP_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { diff --git a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp index 38700abfb4a..3271d933cb2 100644 --- a/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp +++ b/libcxx/test/numerics/rand/rand.adapt/rand.adapt.shuf/result_type.pass.cpp @@ -32,12 +32,14 @@ private: static_assert(Min < Max, "rand1 invalid parameters"); public: - // Temporary work around for lack of constexpr +#ifdef _LIBCPP_HAS_NO_CONSTEXPR + // Workaround for lack of constexpr in C++03 static const result_type _Min = Min; static const result_type _Max = Max; +#endif - static const/*expr*/ result_type min() {return Min;} - static const/*expr*/ result_type max() {return Max;} + static _LIBCPP_CONSTEXPR result_type min() {return Min;} + static _LIBCPP_CONSTEXPR result_type max() {return Max;} explicit rand1(result_type sd = Min) : x_(sd) { |

