From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2152) id 755673858C53; Thu, 7 Apr 2022 02:19:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 755673858C53 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Hans-Peter Nilsson To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-8035] libstdc++-v3 expected: Correct minimal-size test in requirements.cc X-Act-Checkin: gcc X-Git-Author: Hans-Peter Nilsson X-Git-Refname: refs/heads/master X-Git-Oldrev: d9421784980276b42ecdce85b6dde28e965c88c6 X-Git-Newrev: 2dda1094a7c195398c3f2b31519f427ac7d97956 Message-Id: <20220407021951.755673858C53@sourceware.org> Date: Thu, 7 Apr 2022 02:19:51 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 02:19:51 -0000 https://gcc.gnu.org/g:2dda1094a7c195398c3f2b31519f427ac7d97956 commit r12-8035-g2dda1094a7c195398c3f2b31519f427ac7d97956 Author: Hans-Peter Nilsson Date: Thu Apr 7 04:19:21 2022 +0200 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. Diff: --- libstdc++-v3/testsuite/20_util/expected/requirements.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/20_util/expected/requirements.cc b/libstdc++-v3/testsuite/20_util/expected/requirements.cc index 485aa338679..aae7059ef71 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) == 2 ); static_assert( sizeof(std::expected) == 2 ); -static_assert( sizeof(std::expected) == 2 * __alignof(void*) ); +static_assert( sizeof(std::expected) == sizeof(void*) + __alignof(void*) ); static_assert( alignof(std::expected) == 1 ); static_assert( alignof(std::expected) == alignof(void*) );