From patchwork Tue Nov 12 04:53:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1193314 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513021-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jOCPftCU"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="fYYJkrgg"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47BwPs264Fz9s7T for ; Tue, 12 Nov 2019 15:54:06 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type :content-transfer-encoding; q=dns; s=default; b=aB2uUg8CzPw4djL4 0EEIBKsNErMNGAarf/HHYxPAa/11FOMI+okPF9bKS4cWPIIIK7CZBoJNWK3CJUmn OPCQoSY87Oudvs6OHxonCcR+h40ZPt/SH2MsNUi6uoobbPjt1cqk4x2GyvlTkBzQ KFz96yvsmBElJxozx21F5kqDn6o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:content-type :content-transfer-encoding; s=default; bh=ckeODSZk9Eo8Lprd1yhRvC mkHGk=; b=jOCPftCU8bN9ocUiaSzLjChQEd6Ek9Xmvi7ADZfMzcbO10v05lbx6f Zg34yGcgb9NIG2Z3MdSaDFNtc10AAMhITQR3zD02fRzIWhH3zYhpslZ2kCpblrQT gHcAlLV71ui6jBWRTKaXW7MP4qGU7aVnRRMm1WMXq9OFFWjgtXt74= Received: (qmail 107026 invoked by alias); 12 Nov 2019 04:53:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107016 invoked by uid 89); 12 Nov 2019 04:53:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=threeway, three-way X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Nov 2019 04:53:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573534434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P6PWDNT7zjVd3Jst75YZjKU1XjDuaSmzB8q/uxuEPxQ=; b=fYYJkrggJGwuUh4Qlu0oCEyev6YEHEg6JRTwIyo8QvKvgG+WsYO+Jl/fa6eW6+VFqoRhap RBjBnltlqcPFj5Z4ajbBVO5gS6T0MHOGME4li7AYmMhjSJdlMVe9gR3BDHgloPje3SMU4d tM6hDWvwOfjlcgWv2EmmNktiAgZZpHY= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-fZfIYakvPWmsBlmEb7jYbA-1; Mon, 11 Nov 2019 23:53:53 -0500 Received: by mail-qv1-f70.google.com with SMTP id 16so7758130qvq.2 for ; Mon, 11 Nov 2019 20:53:53 -0800 (PST) Received: from barrymore.redhat.com (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id x133sm8809327qka.44.2019.11.11.20.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 20:53:51 -0800 (PST) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [C++ PATCH] Sorry about <=> on VECTOR_TYPE. Date: Mon, 11 Nov 2019 23:53:50 -0500 Message-Id: <20191112045350.27934-1-jason@redhat.com> X-Mimecast-Spam-Score: 0 X-IsSubscribed: yes I'm not sure what semantics we might eventually want for vector <=>, but let's give a sorry for now. Tested x86_64-pc-linux-gnu, applying to trunk. --- gcc/cp/typeck.c | 7 +++++++ gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C base-commit: f15dc29a9734e360497f5bb40be6b25dcbc11645 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 124d16a31fb..ff603f3d8d9 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -5224,6 +5224,13 @@ cp_build_binary_op (const op_location_t &location, "types %qT and %qT", type0, type1); } + if (resultcode == SPACESHIP_EXPR) + { + if (complain & tf_error) + sorry_at (location, "three-way comparison of vectors"); + return error_mark_node; + } + /* Always construct signed integer vector type. */ intt = c_common_type_for_size (GET_MODE_BITSIZE (SCALAR_TYPE_MODE (TREE_TYPE (type0))), 0); diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C new file mode 100644 index 00000000000..83547691118 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-vec1.C @@ -0,0 +1,11 @@ +// { dg-do compile { target c++2a } } + +#include + +#define vector __attribute__((vector_size(4*sizeof(int)) )) + +int main() +{ + vector int a, b; + a <=> b; // { dg-message "three-way comparison of vector" } +}