From patchwork Fri May 12 12:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1780560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=R++1CXAb; dkim-atps=neutral Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QHpJj1zkJz20KG for ; Fri, 12 May 2023 22:40:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B9693858426 for ; Fri, 12 May 2023 12:40:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B9693858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683895235; bh=Bdn8bRHARr3OXs46vKlsPElsZp0d2t3m8lTIuGCPvR4=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=R++1CXAbv4gp5o0++OGOm/ICnOZbfi0yuDRE2riWbdW6I5DrLvOi5pAznEQN+QZF2 XEC553DAQaSdQQ7FNSN8FxzeT2suOQifX1HgfXpfaxVjLYzVIh7iPwAQZNJZd/OTqC 8tBrkJWc/9fKSdgKk/DoHTLHbwNFbivdYDssoKcc= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id A84BC3858425 for ; Fri, 12 May 2023 12:39:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A84BC3858425 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-d0oTT_23PoWWRVv5SxYJJw-1; Fri, 12 May 2023 08:39:18 -0400 X-MC-Unique: d0oTT_23PoWWRVv5SxYJJw-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-621257e86daso80151146d6.1 for ; Fri, 12 May 2023 05:39:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683895157; x=1686487157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bdn8bRHARr3OXs46vKlsPElsZp0d2t3m8lTIuGCPvR4=; b=RMIKHvGCDjYKRqM5G60Mskzx/fdYKf6J/rqNq0H5ekl8JHmGXs8Yy6kFLWQsb9rQbr op3g2FCI1Jw6MYFgqfurgnBUq2XGLWtImsEJ+EUtjxmpMc34Y/EhqG5WyLSFWOXKvHA/ UOSkGp67Y0PN6VmLzpO4SHpfx5CRI1FtRcju6l38q151u8XQJk4gS+bLiPumJeHSr2EC wmJbh9Slh4P2CviKc0jPQcX/AKYNMY1p3y4vy5GMKWKpkeWfsQz0ukv4JwueTHBOMOnO 7TDO3jSOAbnQ5WM3bVb5hA/IZy7DjgsQ7RxNb5HbCzfuPHUijCvQUEI93lhxvknhqLjn lPPQ== X-Gm-Message-State: AC+VfDzjvDeqZGLTmdiH/yzfYmZtPVlBk8J9y/1DVj0sYnXoJKwGVN2C E4l9R5JOOqPSbqR9tQHq2QuJG09iZW3Y1lawVfOPzFZrB/C5e6B7PfrYWWsvpN41Mcx4FtlswMA jlF3ALsBpBiHfM4f+i8UmqezsZzT+8jcJ7QKP9iYu+RxL1GaLKYWu2L8rDXHmd9LQqJlgd9Bgre M= X-Received: by 2002:ad4:5de8:0:b0:5ef:4763:2f61 with SMTP id jn8-20020ad45de8000000b005ef47632f61mr41022723qvb.20.1683895157180; Fri, 12 May 2023 05:39:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+aIU/xcf/pvDxWfGZpB+AK1QN8o/IwDbf2GdhjwU35p5rRwDD00OGpesv7bnICP805oK+bA== X-Received: by 2002:ad4:5de8:0:b0:5ef:4763:2f61 with SMTP id jn8-20020ad45de8000000b005ef47632f61mr41022680qvb.20.1683895156872; Fri, 12 May 2023 05:39:16 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id x12-20020a0cb20c000000b005fdfde87bf3sm2945436qvd.102.2023.05.12.05.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 05:39:16 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Patrick Palka Subject: [pushed] c++: robustify testcase [PR109752] Date: Fri, 12 May 2023 08:39:08 -0400 Message-ID: <20230512123908.1652082-2-ppalka@redhat.com> X-Mailer: git-send-email 2.40.1.552.g91428f078b In-Reply-To: <20230512123908.1652082-1-ppalka@redhat.com> References: <20230512123908.1652082-1-ppalka@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.7 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, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This rewrites the testcase for PR109752 to make it simpler and more robust (i.e. no longer dependent on r13-4035-gc41bbfcaf9d6ef). PR c++/109752 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr109752.C: Rename to ... * g++.dg/cpp2a/concepts-complete4.C: ... this. Rewrite. --- .../g++.dg/cpp2a/concepts-complete4.C | 13 ++++++++++ .../g++.dg/cpp2a/concepts-pr109752.C | 26 ------------------- 2 files changed, 13 insertions(+), 26 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C delete mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C b/gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C new file mode 100644 index 00000000000..988b0ddcfdd --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-complete4.C @@ -0,0 +1,13 @@ +// PR c++/109752 +// { dg-do compile { target c++20 } } + +template +concept C = requires { sizeof(T); } && T::value; // { dg-error "changed from" } + +struct A; + +static_assert(!C); + +struct A { static constexpr bool value = false; }; + +static_assert(C); // { dg-error "assert" } diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C deleted file mode 100644 index d54ce295e50..00000000000 --- a/gcc/testsuite/g++.dg/cpp2a/concepts-pr109752.C +++ /dev/null @@ -1,26 +0,0 @@ -// PR c++/109752 -// { dg-do compile { target c++20 } } - -template - inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...); - template - concept __weakly_eq_cmp_with - = requires(_Tp __t, _Up __u) { { __u != __t } ; // { dg-error "changed from" } - }; - template - concept regular = is_constructible_v<_Tp> && __weakly_eq_cmp_with<_Tp, _Tp>; - template concept incrementable = true -&& regular<_Iter> -&& requires(_Iter __i) { { __i++ } ;} -; -template -struct iterator_interface -{ - friend constexpr bool operator>=(D lhs, D rhs) requires __weakly_eq_cmp_with { return true; } -}; -template -struct iterator : iterator_interface> -{ - bool operator==(iterator) const; -}; -static_assert(incrementable>); // { dg-error "assert" }