From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) by sourceware.org (Postfix) with ESMTPS id EF73D3856DC7 for ; Thu, 20 Jul 2023 03:22:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF73D3856DC7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-635eedf073eso2715376d6.2 for ; Wed, 19 Jul 2023 20:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689823374; x=1690428174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OwktZeQuEoCCedkhYXOS+gKdYdzUc6g5q2OVpx+hmAk=; b=lApMhZBhU4XRXL32U8i/nuvaHOD7K5CTGBtOURrfaLPKyocOSnJU4isQg+/1RfbR8H RFFLLbxMIHdwd0ZWtahNYqxIxet7gp3+Eitf98zBCzMxPqqSRxSWoaWftdum/pULBOAm N/KVqBB8BXb1EICJCOPXai1k5M0+RyZNSth2FL5NAPu5kPhz3ydzDwg+1bKyC67mgr6V 2u6iSC/43bDS3vb6MjdtP2bmWMQ6W9Nu5Ml+BSbKFwuOwjMlHbejuB7mYQ4tPJrmyE+Z 3Pqv/kZZvcmoQRw9QHY4npl8qc+1lMcfPgDpjjuRuvDfoQ5auujwmcKO8haVhM2bQTKQ phDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689823374; x=1690428174; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OwktZeQuEoCCedkhYXOS+gKdYdzUc6g5q2OVpx+hmAk=; b=SzKLK4YlF2Hgi1vnDRr2t91U2WcQ0A0WtNpFpBb0yDD6C4nn5Bl2K3nW4Qb5umheoj ldw5QIWVW2mFPqo7w+nCFfo91nvB+Jr6HgxcDjLZBoKYIVcJsYRNaDDiUazyYfZscA1t jPUCnhFgLjngBcE6QiA2JKCozBls7GRwfe/LNjhz6M6mF7dLIJvaNewWYrb+Xu/vouj9 qyLY650PVYFpJzXOdL1BmYAljHf+i5mPFfgtNcsWlepqQD2P5M9tSuOqf0qqSb1MehN4 3ziYu4FqwXXoiFXhDKMH+dvYurldEn7LxG9W8hAqGYvkdM7o8z0QFkaERKKWFQbm3PCm /Gkg== X-Gm-Message-State: ABy/qLb38QsAtxfM5sE6wAcWYiLe3z/1uXB+j+OPoDapO7WWIOOV+t1f oLMUI5zIhf+VCQ2reHFIpVSFqT9+Me0= X-Google-Smtp-Source: APBJJlE82OFGsTrPH7BLivp4tbt2qjXBwTkgP9JJ39Thd8UDn14BL7E1VRl2YBR9rWs3+DmgpwNJUQ== X-Received: by 2002:a05:6214:2af:b0:634:d868:f0d5 with SMTP id m15-20020a05621402af00b00634d868f0d5mr17733280qvv.9.1689823374030; Wed, 19 Jul 2023 20:22:54 -0700 (PDT) Received: from localhost.localdomain (96-67-140-173-static.hfc.comcastbusiness.net. [96.67.140.173]) by smtp.gmail.com with ESMTPSA id o11-20020a0cf4cb000000b00635fc10afd6sm29678qvm.70.2023.07.19.20.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 20:22:53 -0700 (PDT) From: Lewis Hyatt To: gcc-patches@gcc.gnu.org Cc: Lewis Hyatt Subject: [committed] testsuite: Fix C++ UDL tests failing on 32-bit arch [PR103902] Date: Wed, 19 Jul 2023 23:22:43 -0400 Message-Id: <20230720032243.3643540-1-lhyatt@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3038.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: These tests need to use "size_t" rather than "unsigned long" for the user-defined literal function arguments. gcc/testsuite/ChangeLog: PR preprocessor/103902 * g++.dg/cpp0x/udlit-extended-id-1.C: Change "unsigned long" to "size_t" throughout. * g++.dg/cpp0x/udlit-extended-id-3.C: Likewise. --- Notes: Hello- As noted on the PR, these newly added tests fail on 32-bit architectures because they said "unsigned long" where they are supposed to say "size_t". Committed this fix as obvious. -Lewis gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C | 9 +++++---- gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C index 5ea5ef09db6..c7091e9e8a2 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-1.C @@ -1,6 +1,7 @@ // { dg-do run { target c++11 } } // { dg-additional-options "-Wno-error=normalized" } #include +#include using namespace std; constexpr unsigned long long operator "" _π (unsigned long long x) @@ -21,22 +22,22 @@ char x2[2_Π2]; static_assert (sizeof x1 == 3, "test1"); static_assert (sizeof x2 == 8, "test2"); -const char * operator "" _1σ (const char *s, unsigned long) +const char * operator "" _1σ (const char *s, size_t) { return s + 1; } -const char * operator ""_Σ2 (const char *s, unsigned long) +const char * operator ""_Σ2 (const char *s, size_t) { return s + 2; } -const char * operator "" _\U000000e61 (const char *s, unsigned long) +const char * operator "" _\U000000e61 (const char *s, size_t) { return "ae"; } -const char* operator ""_\u01532 (const char *s, unsigned long) +const char* operator ""_\u01532 (const char *s, size_t) { return "oe"; } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C index 11292e476e3..cb8a957947a 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-extended-id-3.C @@ -1,9 +1,11 @@ // { dg-do compile { target c++11 } } +#include +using namespace std; // Check that we do not look for poisoned identifier when it is a suffix. int _ħ; #pragma GCC poison _ħ -const char * operator ""_ħ (const char *, unsigned long); // { dg-bogus "poisoned" } +const char * operator ""_ħ (const char *, size_t); // { dg-bogus "poisoned" } bool operator ""_ħ (unsigned long long x); // { dg-bogus "poisoned" } bool b = 1_ħ; // { dg-bogus "poisoned" } const char *x = "hbar"_ħ; // { dg-bogus "poisoned" } @@ -11,5 +13,5 @@ const char *x = "hbar"_ħ; // { dg-bogus "poisoned" } /* Ideally, we should not warn here either, but this is not implemented yet. This syntax has been deprecated for C++23. */ #pragma GCC poison _ħ2 -const char * operator "" _ħ2 (const char *, unsigned long); // { dg-bogus "poisoned" "" { xfail *-*-*} } +const char * operator "" _ħ2 (const char *, size_t); // { dg-bogus "poisoned" "" { xfail *-*-*} } const char *x2 = "hbar2"_ħ2; // { dg-bogus "poisoned" }