public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Marek Polacek <mpolacek@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-9392] c++: Fix decltype-bitfield1.C on i?86 Date: Wed, 15 Dec 2021 20:25:38 +0000 (GMT) [thread overview] Message-ID: <20211215202538.F2D113858D28@sourceware.org> (raw) https://gcc.gnu.org/g:64b314719afa4d947a82183b8a4ba2f17befa00b commit r11-9392-g64b314719afa4d947a82183b8a4ba2f17befa00b Author: Marek Polacek <polacek@redhat.com> Date: Tue Dec 7 16:06:19 2021 -0500 c++: Fix decltype-bitfield1.C on i?86 This test was failing on i?86 because of: warning: width of 'A::l' exceeds its type so change the type to 'long long' and make the test run only on arches where sizeof(long long) == 8 to avoid failing like this again. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/decltype-bitfield1.C: Change a type to unsigned long long. Only run on longlong64 targets. (cherry picked from commit cf2cd61dce4f5f0cf9d72328396e7f949db18ddb) Diff: --- gcc/testsuite/g++.dg/cpp0x/decltype-bitfield1.C | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-bitfield1.C b/gcc/testsuite/g++.dg/cpp0x/decltype-bitfield1.C index 2d8d8e81bff..27289fb8580 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype-bitfield1.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-bitfield1.C @@ -1,5 +1,5 @@ // PR c++/95009 -// { dg-do compile { target c++11 } } +// { dg-do compile { target { c++11 && longlong64 } } } struct false_type { static constexpr bool value = false; }; struct true_type { static constexpr bool value = true; }; @@ -10,7 +10,7 @@ struct is_same<T, T> : true_type {}; struct A { int i : 31; - unsigned long l : 37; + unsigned long long l : 37; } a; void @@ -40,26 +40,26 @@ g () static_assert (is_same<decltype(~a.i), int>::value, ""); static_assert (is_same<decltype((~a.i)), int>::value, ""); - static_assert (is_same<decltype(a.l), unsigned long>::value, ""); - static_assert (is_same<decltype((a.l)), unsigned long&>::value, ""); - static_assert (is_same<decltype(++a.l), unsigned long&>::value, ""); - static_assert (is_same<decltype((++a.l)), unsigned long&>::value, ""); - static_assert (is_same<decltype(a.l++), unsigned long>::value, ""); - static_assert (is_same<decltype((a.l++)), unsigned long>::value, ""); - static_assert (is_same<decltype(--a.l), unsigned long&>::value, ""); - static_assert (is_same<decltype((--a.l)), unsigned long&>::value, ""); - static_assert (is_same<decltype(a.l--), unsigned long>::value, ""); - static_assert (is_same<decltype((a.l--)), unsigned long>::value, ""); - static_assert (is_same<decltype(a.l += 1), unsigned long&>::value, ""); - static_assert (is_same<decltype((a.l += 1)), unsigned long&>::value, ""); - static_assert (is_same<decltype(a.l -= 1), unsigned long&>::value, ""); - static_assert (is_same<decltype((a.l -= 1)), unsigned long&>::value, ""); - static_assert (is_same<decltype(a.l *= 1), unsigned long&>::value, ""); - static_assert (is_same<decltype((a.l *= 1)), unsigned long&>::value, ""); - static_assert (is_same<decltype(+a.l), unsigned long>::value, ""); - static_assert (is_same<decltype((+a.l)), unsigned long>::value, ""); - static_assert (is_same<decltype(-a.l), unsigned long>::value, ""); - static_assert (is_same<decltype((-a.l)), unsigned long>::value, ""); - static_assert (is_same<decltype(~a.l), unsigned long>::value, ""); - static_assert (is_same<decltype((~a.l)), unsigned long>::value, ""); + static_assert (is_same<decltype(a.l), unsigned long long>::value, ""); + static_assert (is_same<decltype((a.l)), unsigned long long&>::value, ""); + static_assert (is_same<decltype(++a.l), unsigned long long&>::value, ""); + static_assert (is_same<decltype((++a.l)), unsigned long long&>::value, ""); + static_assert (is_same<decltype(a.l++), unsigned long long>::value, ""); + static_assert (is_same<decltype((a.l++)), unsigned long long>::value, ""); + static_assert (is_same<decltype(--a.l), unsigned long long&>::value, ""); + static_assert (is_same<decltype((--a.l)), unsigned long long&>::value, ""); + static_assert (is_same<decltype(a.l--), unsigned long long>::value, ""); + static_assert (is_same<decltype((a.l--)), unsigned long long>::value, ""); + static_assert (is_same<decltype(a.l += 1), unsigned long long&>::value, ""); + static_assert (is_same<decltype((a.l += 1)), unsigned long long&>::value, ""); + static_assert (is_same<decltype(a.l -= 1), unsigned long long&>::value, ""); + static_assert (is_same<decltype((a.l -= 1)), unsigned long long&>::value, ""); + static_assert (is_same<decltype(a.l *= 1), unsigned long long&>::value, ""); + static_assert (is_same<decltype((a.l *= 1)), unsigned long long&>::value, ""); + static_assert (is_same<decltype(+a.l), unsigned long long>::value, ""); + static_assert (is_same<decltype((+a.l)), unsigned long long>::value, ""); + static_assert (is_same<decltype(-a.l), unsigned long long>::value, ""); + static_assert (is_same<decltype((-a.l)), unsigned long long>::value, ""); + static_assert (is_same<decltype(~a.l), unsigned long long>::value, ""); + static_assert (is_same<decltype((~a.l)), unsigned long long>::value, ""); }
reply other threads:[~2021-12-15 20:25 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211215202538.F2D113858D28@sourceware.org \ --to=mpolacek@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).