From patchwork Wed Jun 12 20:29:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1947114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=GX6YlbT7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VzxxY4T5tz20Pb for ; Thu, 13 Jun 2024 06:30:25 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D8F293882071 for ; Wed, 12 Jun 2024 20:30:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id BEF0D388204B for ; Wed, 12 Jun 2024 20:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEF0D388204B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BEF0D388204B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718224203; cv=none; b=GMjHGs6kHJPO/+kbiErRWWfDdYKwjQaSsIfca1Aa5i2x7xB2PqOPzRFKYyTkeyBI8apQDag6q0HzsRO44dQEoKgbmDzK+t/HsuR91o00xsUoltBnDoH67gS9xiHCoTzv1JRZ/tVt9OFICTg4pdxa3cuhiuqUT6o6K6aEh7VDiAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718224203; c=relaxed/simple; bh=ns4ulW1HOnkanlN/kSShe/3OsrXzz9RFCOxLRbi9eos=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oiPBtqj00Bo5SJPRWg/wQtKpdmN81+iSa078sYkJ9Yc7kH3ZjzirAeWlwBO57iDe0On31OZDi+oD5f3vnb/vyM4tc/Vz5RxheKjhkQXMpRYEAudiA/4pQ5ecxiNqPiVtOoQSY0rg0xylGuAfV2WDoPA5kWLLNISJ21laeW9+AR8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718224201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xcrs1fx+gigNuIMJ2dRx3IA6sDtzz4cwcX5NuJCMIkQ=; b=GX6YlbT7eEwOo9u4pe77HwfKWatmw59mL0/5bfkluKAUYwXrhlrMVcRWwKJkU4VYWRmvzy cnLEn6YtDl/JLG7iG4+GI7yYynRQ6YL1foD8Ctl68bnNWG/N+EEVMUsPA/Nnz8W9bHxeMi tNmB50WFiZkkgRBnLdXOAeRJ0LJp+PU= Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-272-2n4-3_tLMyqL-AOIB1pLRw-1; Wed, 12 Jun 2024 16:29:58 -0400 X-MC-Unique: 2n4-3_tLMyqL-AOIB1pLRw-1 Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-4e4f01ebd4bso66284e0c.3 for ; Wed, 12 Jun 2024 13:29:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718224198; x=1718828998; 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=xcrs1fx+gigNuIMJ2dRx3IA6sDtzz4cwcX5NuJCMIkQ=; b=r0mdioe1gYVju7/mFMs7HMGJbGNuMeJaneWnFv3Oyl9l0JbJhNWqM1mWG1fKD2M7W3 cv8n7Pvb65GjLts3RUoaW7Anms40UMKlRi6CVzxQDLI4KmWE1ZXcSETA7jqazIXLikIN 353DFv8fzlvOhr9UeZKaeFm6nea8yp3kV9EFu0L1Dn1jIZa+vJM/EU0Fyn95SePaKsQV 2aJY9/s+5K1eXe8czU1jcpwbSepnsFdypnBWVslJhCa90clEleQ1u/fMWCtsBuZROrR5 ZYrQle4Imw7rOwdB6HjuTVSQ5BhzGXSfOhIjpiRPdAfLkumIUwbpyjRCXiDtSD5IBvTw 0glA== X-Gm-Message-State: AOJu0YwWiqbwTRZrSmgrqZIUz+aaEhsliRgo3BSoQGGJzOk5HFb92JYt eTI5ZR+MCgMsZNelFY9L0o9HMJ4Vk4v8kie0oTcIM4fPjJo3bdPDvdWN4dSap5JRVC1blM5DHeF 2WDVwQoYokZ3sPI+zgBt2qZxZvQuNTmxxOA9BEDmSOWO+J2ulP6uHLPh2S9d8EsjlFsI882JtaE EX5HuNyFy/7DZ4HaEaTiNQ8PseXzW+TcrMo90= X-Received: by 2002:a05:6122:49:b0:4ec:fe12:4559 with SMTP id 71dfb90a1353d-4ed07bfa99fmr2854945e0c.13.1718224197912; Wed, 12 Jun 2024 13:29:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUghR9JZIZzV9fLA/wJgwFjw+XMuPDyjViv1tpNhr/hq3CsYVCaXwTDa5XI/U3WlCq/GZjzQ== X-Received: by 2002:a05:6122:49:b0:4ec:fe12:4559 with SMTP id 71dfb90a1353d-4ed07bfa99fmr2854918e0c.13.1718224197384; Wed, 12 Jun 2024 13:29:57 -0700 (PDT) Received: from jason-thinkpadp1gen4i.rmtusma.csb (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id af79cd13be357-797f5be105bsm81547285a.117.2024.06.12.13.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 13:29:57 -0700 (PDT) From: Jason Merrill To: gcc-patches@gcc.gnu.org Cc: Andi Kleen Subject: [pushed] c++: fix testcase diagnostics Date: Wed, 12 Jun 2024 16:29:29 -0400 Message-ID: <20240612202955.2524339-1-jason@redhat.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The r15-1180 adjustments to this testcase broke a couple of tests in C++26 mode. gcc/testsuite/ChangeLog: * g++.dg/cpp26/static_assert1.C: Fix diagnostic typos. --- gcc/testsuite/g++.dg/cpp26/static_assert1.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: eaff4d6714805ba2504270dfff51fca61854542d diff --git a/gcc/testsuite/g++.dg/cpp26/static_assert1.C b/gcc/testsuite/g++.dg/cpp26/static_assert1.C index 7840b6b04d2..f9ac8311b82 100644 --- a/gcc/testsuite/g++.dg/cpp26/static_assert1.C +++ b/gcc/testsuite/g++.dg/cpp26/static_assert1.C @@ -286,14 +286,14 @@ namespace NN }; static_assert (true, M{}); // { dg-warning "'static_assert' with non-string message only available with" "" { target c++23_only } } static_assert (false, M{}); // { dg-warning "'static_assert' with non-string message only available with" "" { target c++23_only } } - // { dg-error "'constexpr string 'size\\\(\\\)' must be a constant expression" "" { target c++23 } .-1 } + // { dg-error "constexpr string 'size\\\(\\\)' must be a constant expression" "" { target c++23 } .-1 } struct N { static constexpr int size () { return 4; } static constexpr const char *data () { if consteval { throw 1; } else { return "test"; } } // { dg-error "expression '' is not a constant expression" "" { target c++23 } } }; static_assert (true, N{}); // { dg-warning "'static_assert' with non-string message only available with" "" { target c++23_only } } static_assert (false, N{}); // { dg-warning "'static_assert' with non-string message only available with" "" { target c++23_only } } - // { dg-error "'constexpr string 'data\\\(\\\)\\\[0\\\]' must be a constant expression" "" { target c++23 } .-1 } + // { dg-error "constexpr string 'data\\\(\\\)\\\[0\\\]' must be a constant expression" "" { target c++23 } .-1 } #endif struct O { constexpr int operator () () const { return 12; } }; struct P { constexpr const char *operator () () const { return "another test"; } };