aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2022-04-07 04:19:21 +0200
committerHans-Peter Nilsson <hp@axis.com>2022-04-07 04:19:21 +0200
commit2dda1094a7c195398c3f2b31519f427ac7d97956 (patch)
tree0241199d92e8dfdfc6598843640b9cd8de02e2ba
parentd9421784980276b42ecdce85b6dde28e965c88c6 (diff)
downloadgcc-2dda1094a7c195398c3f2b31519f427ac7d97956.zip
gcc-2dda1094a7c195398c3f2b31519f427ac7d97956.tar.gz
gcc-2dda1094a7c195398c3f2b31519f427ac7d97956.tar.bz2
libstdc++-v3 expected: Correct minimal-size test in requirements.cc
Without this, for a target where alignment and structure-sizes are by default byte-aligned, such as cris-elf, you'll see, in libstdc++.log: /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: error: static assertion failed /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: note: the comparison reduces to '(5 == 2)' compiler exited with status 1 FAIL: 20_util/expected/requirements.cc (test for excess errors) Excess errors: /X/gcc/libstdc++-v3/testsuite/20_util/expected/requirements.cc:127: error: static assertion failed The intent of that line is to check that the object is not larger than necessary. libstdc++-v3/: * testsuite/20_util/expected/requirements.cc: Correct minimal-size test.
-rw-r--r--libstdc++-v3/testsuite/20_util/expected/requirements.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/20_util/expected/requirements.cc b/libstdc++-v3/testsuite/20_util/expected/requirements.cc
index 485aa33..aae7059 100644
--- a/libstdc++-v3/testsuite/20_util/expected/requirements.cc
+++ b/libstdc++-v3/testsuite/20_util/expected/requirements.cc
@@ -124,6 +124,6 @@ static_assert( move_assignable< void, G > );
// QoI properties
static_assert( sizeof(std::expected<char, unsigned char>) == 2 );
static_assert( sizeof(std::expected<void, char>) == 2 );
-static_assert( sizeof(std::expected<void*, char>) == 2 * __alignof(void*) );
+static_assert( sizeof(std::expected<void*, char>) == sizeof(void*) + __alignof(void*) );
static_assert( alignof(std::expected<void, char>) == 1 );
static_assert( alignof(std::expected<void*, char>) == alignof(void*) );