summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/language.support
diff options
context:
space:
mode:
authorCasey Carter <Casey@Carter.net>2017-05-12 20:33:32 +0000
committerCasey Carter <Casey@Carter.net>2017-05-12 20:33:32 +0000
commitef475c4d7183a32c35e753f579e98da331867123 (patch)
tree2ab7fad0b229cd15bf6f079213188b555f0f9146 /libcxx/test/std/language.support
parent161e8c39af4b7ff6ddce76ffe7aa78fc1f35583f (diff)
downloadbcm5719-llvm-ef475c4d7183a32c35e753f579e98da331867123.tar.gz
bcm5719-llvm-ef475c4d7183a32c35e753f579e98da331867123.zip
[test] Avoid P0138R2, direct-list-init of fixed enums from integers, part 1/3.
This C++17 Core Language feature isn't necessary when testing std::byte. It's a minor convenience, but it limits test coverage to very new compilers. This part changes the code. Fixes D32386. llvm-svn: 302944
Diffstat (limited to 'libcxx/test/std/language.support')
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/and.assign.pass.cpp6
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/and.pass.cpp6
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp4
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/lshift.fail.cpp2
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/lshift.pass.cpp4
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/not.pass.cpp6
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/or.assign.pass.cpp6
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/or.pass.cpp6
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp4
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/rshift.fail.cpp2
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/rshift.pass.cpp4
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/to_integer.fail.cpp2
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/to_integer.pass.cpp4
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/xor.assign.pass.cpp6
-rw-r--r--libcxx/test/std/language.support/support.types/byteops/xor.pass.cpp6
15 files changed, 34 insertions, 34 deletions
diff --git a/libcxx/test/std/language.support/support.types/byteops/and.assign.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/and.assign.pass.cpp
index dec241eb0c4..1c9790e2ca9 100644
--- a/libcxx/test/std/language.support/support.types/byteops/and.assign.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/and.assign.pass.cpp
@@ -26,9 +26,9 @@ constexpr std::byte test(std::byte b1, std::byte b2) {
int main () {
std::byte b; // not constexpr, just used in noexcept check
- constexpr std::byte b1{1};
- constexpr std::byte b8{8};
- constexpr std::byte b9{9};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
+ constexpr std::byte b9{static_cast<std::byte>(9)};
static_assert(noexcept(b &= b), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/and.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/and.pass.cpp
index 22da6e3e0d4..7ed80a0085a 100644
--- a/libcxx/test/std/language.support/support.types/byteops/and.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/and.pass.cpp
@@ -18,9 +18,9 @@
// constexpr byte operator&(byte l, byte r) noexcept;
int main () {
- constexpr std::byte b1{1};
- constexpr std::byte b8{8};
- constexpr std::byte b9{9};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
+ constexpr std::byte b9{static_cast<std::byte>(9)};
static_assert(noexcept(b1 & b8), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
index dad692e14a6..f19a02163c8 100644
--- a/libcxx/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
@@ -28,8 +28,8 @@ constexpr std::byte test(std::byte b) {
int main () {
std::byte b; // not constexpr, just used in noexcept check
- constexpr std::byte b2{2};
- constexpr std::byte b3{3};
+ constexpr std::byte b2{static_cast<std::byte>(2)};
+ constexpr std::byte b3{static_cast<std::byte>(3)};
static_assert(noexcept(b <<= 2), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/lshift.fail.cpp b/libcxx/test/std/language.support/support.types/byteops/lshift.fail.cpp
index 6b1a68f83d2..e2f7c95c1bf 100644
--- a/libcxx/test/std/language.support/support.types/byteops/lshift.fail.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/lshift.fail.cpp
@@ -21,6 +21,6 @@
// is_integral_v<IntegerType> is true.
int main () {
- constexpr std::byte b1{1};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
constexpr std::byte b2 = b1 << 2.0f;
}
diff --git a/libcxx/test/std/language.support/support.types/byteops/lshift.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/lshift.pass.cpp
index 39d659023ad..831673aacc9 100644
--- a/libcxx/test/std/language.support/support.types/byteops/lshift.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/lshift.pass.cpp
@@ -21,8 +21,8 @@
// is_integral_v<IntegerType> is true.
int main () {
- constexpr std::byte b1{1};
- constexpr std::byte b3{3};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b3{static_cast<std::byte>(3)};
static_assert(noexcept(b3 << 2), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/not.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/not.pass.cpp
index 734780f194a..55f26f774cf 100644
--- a/libcxx/test/std/language.support/support.types/byteops/not.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/not.pass.cpp
@@ -18,9 +18,9 @@
// constexpr byte operator~(byte b) noexcept;
int main () {
- constexpr std::byte b1{1};
- constexpr std::byte b2{2};
- constexpr std::byte b8{8};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b2{static_cast<std::byte>(2)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
static_assert(noexcept(~b1), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/or.assign.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/or.assign.pass.cpp
index 75d6ab4d0a9..51d983547ad 100644
--- a/libcxx/test/std/language.support/support.types/byteops/or.assign.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/or.assign.pass.cpp
@@ -26,9 +26,9 @@ constexpr std::byte test(std::byte b1, std::byte b2) {
int main () {
std::byte b; // not constexpr, just used in noexcept check
- constexpr std::byte b1{1};
- constexpr std::byte b2{2};
- constexpr std::byte b8{8};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b2{static_cast<std::byte>(2)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
static_assert(noexcept(b |= b), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/or.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/or.pass.cpp
index 02c547f1dbb..24e6fe7af22 100644
--- a/libcxx/test/std/language.support/support.types/byteops/or.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/or.pass.cpp
@@ -18,9 +18,9 @@
// constexpr byte operator|(byte l, byte r) noexcept;
int main () {
- constexpr std::byte b1{1};
- constexpr std::byte b2{2};
- constexpr std::byte b8{8};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b2{static_cast<std::byte>(2)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
static_assert(noexcept(b1 | b2), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
index b7e9a24f20a..23db61ce3a2 100644
--- a/libcxx/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
@@ -28,8 +28,8 @@ constexpr std::byte test(std::byte b) {
int main () {
std::byte b; // not constexpr, just used in noexcept check
- constexpr std::byte b16{16};
- constexpr std::byte b192{192};
+ constexpr std::byte b16{static_cast<std::byte>(16)};
+ constexpr std::byte b192{static_cast<std::byte>(192)};
static_assert(noexcept(b >>= 2), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/rshift.fail.cpp b/libcxx/test/std/language.support/support.types/byteops/rshift.fail.cpp
index a0309539a7a..74f19fdbd2c 100644
--- a/libcxx/test/std/language.support/support.types/byteops/rshift.fail.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/rshift.fail.cpp
@@ -21,6 +21,6 @@
// is_integral_v<IntegerType> is true.
int main () {
- constexpr std::byte b1{1};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
constexpr std::byte b2 = b1 >> 2.0f;
}
diff --git a/libcxx/test/std/language.support/support.types/byteops/rshift.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/rshift.pass.cpp
index 876732545ac..9b1c25872a5 100644
--- a/libcxx/test/std/language.support/support.types/byteops/rshift.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/rshift.pass.cpp
@@ -27,8 +27,8 @@ constexpr std::byte test(std::byte b) {
int main () {
- constexpr std::byte b100{100};
- constexpr std::byte b115{115};
+ constexpr std::byte b100{static_cast<std::byte>(100)};
+ constexpr std::byte b115{static_cast<std::byte>(115)};
static_assert(noexcept(b100 << 2), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/to_integer.fail.cpp b/libcxx/test/std/language.support/support.types/byteops/to_integer.fail.cpp
index 426ceb7a67d..add3168e92f 100644
--- a/libcxx/test/std/language.support/support.types/byteops/to_integer.fail.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/to_integer.fail.cpp
@@ -21,6 +21,6 @@
// is_integral_v<IntegerType> is true.
int main () {
- constexpr std::byte b1{1};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
auto f = std::to_integer<float>(b1);
}
diff --git a/libcxx/test/std/language.support/support.types/byteops/to_integer.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/to_integer.pass.cpp
index 21dff0196a4..353ef3a4ef4 100644
--- a/libcxx/test/std/language.support/support.types/byteops/to_integer.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/to_integer.pass.cpp
@@ -21,8 +21,8 @@
// is_integral_v<IntegerType> is true.
int main () {
- constexpr std::byte b1{1};
- constexpr std::byte b3{3};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b3{static_cast<std::byte>(3)};
static_assert(noexcept(std::to_integer<int>(b1)), "" );
static_assert(std::is_same<int, decltype(std::to_integer<int>(b1))>::value, "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/xor.assign.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/xor.assign.pass.cpp
index c9b40177a17..0d2e7cfd655 100644
--- a/libcxx/test/std/language.support/support.types/byteops/xor.assign.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/xor.assign.pass.cpp
@@ -26,9 +26,9 @@ constexpr std::byte test(std::byte b1, std::byte b2) {
int main () {
std::byte b; // not constexpr, just used in noexcept check
- constexpr std::byte b1{1};
- constexpr std::byte b8{8};
- constexpr std::byte b9{9};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
+ constexpr std::byte b9{static_cast<std::byte>(9)};
static_assert(noexcept(b ^= b), "" );
diff --git a/libcxx/test/std/language.support/support.types/byteops/xor.pass.cpp b/libcxx/test/std/language.support/support.types/byteops/xor.pass.cpp
index 3d0402b30a5..fed71df0154 100644
--- a/libcxx/test/std/language.support/support.types/byteops/xor.pass.cpp
+++ b/libcxx/test/std/language.support/support.types/byteops/xor.pass.cpp
@@ -18,9 +18,9 @@
// constexpr byte operator^(byte l, byte r) noexcept;
int main () {
- constexpr std::byte b1{1};
- constexpr std::byte b8{8};
- constexpr std::byte b9{9};
+ constexpr std::byte b1{static_cast<std::byte>(1)};
+ constexpr std::byte b8{static_cast<std::byte>(8)};
+ constexpr std::byte b9{static_cast<std::byte>(9)};
static_assert(noexcept(b1 ^ b8), "" );
OpenPOWER on IntegriCloud