From patchwork Tue Apr 13 18:44:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1465927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: 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=BeIyMlZH; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FKZKB5qHZz9sWW for ; Wed, 14 Apr 2021 04:44:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A3E573949D80; Tue, 13 Apr 2021 18:44:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3E573949D80 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1618339482; bh=iVhchb/d4+9t6zloJf9ObY9Kx0Z+cwGKochRYZ4no8s=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=BeIyMlZHjrUFRQQvnKpeqV2uXU73YHdqa4ke8VbZhY6IcRmoiNggB8Slis594sGdh 3/YTSX/qpEwsNYcXOBFNA8U81jOmI8E+UGeAKLOZUFRXkwTR+UPskZecfUZAe8e0Nd vksaXiIMQ1a06Zc6zgYIunLq8Js4RCvIzv0AcH/w= 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 ESMTP id EEBB73949D80 for ; Tue, 13 Apr 2021 18:44:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EEBB73949D80 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-TqHzqppHMuaLyuHgTmut9g-1; Tue, 13 Apr 2021 14:44:37 -0400 X-MC-Unique: TqHzqppHMuaLyuHgTmut9g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0377864149 for ; Tue, 13 Apr 2021 18:44:37 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-115-183.ams2.redhat.com [10.36.115.183]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A51075D9D0 for ; Tue, 13 Apr 2021 18:44:36 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 13DIiXTD3186134 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Tue, 13 Apr 2021 20:44:34 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 13DIiXer3186133 for gcc-patches@gcc.gnu.org; Tue, 13 Apr 2021 20:44:33 +0200 Date: Tue, 13 Apr 2021 20:44:33 +0200 To: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Add testcase for already fixed PR97121 Message-ID: <20210413184433.GM1179226@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! This was fixed by r11-5866 aka PR96299 fix. This just adds a testcase for it into the testsuite, tested on x86_64-linux -m32/-m64, committed to trunk. 2021-04-13 Jakub Jelinek PR c++/97121 * g++.dg/cpp2a/spaceship-err6.C: New test. Jakub --- gcc/testsuite/g++.dg/cpp2a/spaceship-err6.C.jj 2021-04-13 20:33:40.206442108 +0200 +++ gcc/testsuite/g++.dg/cpp2a/spaceship-err6.C 2021-04-13 20:38:23.740283353 +0200 @@ -0,0 +1,20 @@ +// PR c++/97121 +// { dg-do compile { target c++20 } } + +#include + +class MyClass +{ + int mValue; // { dg-error "three-way comparison of 'MyClass::mValue' has type 'std::strong_ordering', which does not convert to 'bool'" } + +public: + MyClass(int value): mValue(value) {} + + bool operator<=>(const MyClass&) const = default; +}; + +int main() +{ + MyClass a = 10, b = 15; + return (a < b); // { dg-error "use of deleted function 'constexpr bool MyClass::operator<=>\\\(const MyClass&\\\) const'" } +}