public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-8035] libstdc++-v3 expected: Correct minimal-size test in requirements.cc
@ 2022-04-07  2:19 Hans-Peter Nilsson
  0 siblings, 0 replies; only message in thread
From: Hans-Peter Nilsson @ 2022-04-07  2:19 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:2dda1094a7c195398c3f2b31519f427ac7d97956

commit r12-8035-g2dda1094a7c195398c3f2b31519f427ac7d97956
Author: Hans-Peter Nilsson <hp@axis.com>
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<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*) );


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-07  2:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07  2:19 [gcc r12-8035] libstdc++-v3 expected: Correct minimal-size test in requirements.cc Hans-Peter Nilsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).