From patchwork Sat Feb 15 21:21:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 1238642 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-519608-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.a=rsa-sha1 header.s=default header.b=VNKPML6L; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=M4hT6hJz; 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 48KjrG34VLz9sSJ for ; Sun, 16 Feb 2020 08:22:20 +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=RK2gFgygjVXd/Biv vtpTh9hdXiVZz4i6buBQh74+LTEuUOstnQpgXCILIQAPWXpmohCmeF4SEuimBZpn z19urHyh2/ClAOJHdf3WnsnEG8Zo3aW7hwfRUwfIksTp7LdXP0lNln4+g5QpvY+N RZ1Lk/8EQbMfVtML6tN+uAPZ1vU= 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=JOWwsq4mh1Ttez5Zrua/Ta rvWLo=; b=VNKPML6LA7COK0KXT4Zcw0N14eN11CryxOjY2NyeUyKteFadMXKYBT EHGc8sttdmB22aZCauPw8h1h66zckfdfd1lTr/WAidAvt/9h3MUayqz6Z5yCoXPK X4RcjyTn88BJguLg+DKP7Mpybm998PDUIVeHtXu+VH/LY+4QXw64w= Received: (qmail 1511 invoked by alias); 15 Feb 2020 21:22:11 -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 1503 invoked by uid 89); 15 Feb 2020 21:22:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Google-Smtp-Source:APXvYqyI, extensive X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 15 Feb 2020 21:22:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581801727; 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=/Zm+YDGNxmwCtjqiEMY+ux+P3ZRGclfyFZR1Xxf1PF0=; b=M4hT6hJzX1XJGRQQn456uEQpU1hjjwau4wS/7Y+DbsgHIhyrJC2p1ErQfxxVw8+kPXtX9S O5cnQK3ub2oOWEe+OpufiyrYKr9KwCn++uKwLTfB1qvKS2mEV0bwm6ykhfIwz8u+Vy6u8E OiyYB4ModddO+Bvb4AlIAil76X8TSco= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-137-vHSAjsWCPjO5ahBJpnvseA-1; Sat, 15 Feb 2020 16:21:53 -0500 Received: by mail-wr1-f70.google.com with SMTP id w6so6302916wrm.16 for ; Sat, 15 Feb 2020 13:21:53 -0800 (PST) Received: from barrymore.cygnus.csb ([193.85.242.99]) by smtp.gmail.com with ESMTPSA id x17sm12459985wrt.74.2020.02.15.13.21.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2020 13:21:50 -0800 (PST) From: Jason Merrill To: gcc-patches@gcc.gnu.org Subject: [committed] c++: Add -std=c++20. Date: Sat, 15 Feb 2020 22:21:49 +0100 Message-Id: <20200215212149.26959-1-jason@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-IsSubscribed: yes It's probably past time for this, but definitely now that we're done with the final committee meeting of C++20. This patch only adds the option and adjusts the testsuite to recognize it; more extensive changes can wait for the published standard. Tested x86_64-pc-linux-gnu, applying to trunk. gcc/ChangeLog 2020-02-15 Jason Merrill * doc/invoke.texi (C Dialect Options): Add -std=c++20. gcc/c-family/ChangeLog 2020-02-15 Jason Merrill * c.opt: Add -std=c++20. gcc/testsuite/ChangeLog 2020-02-15 Jason Merrill * lib/target-supports.exp (check_effective_target_c++2a_only): Also look for -std=*++20. (check_effective_target_concepts): Use check_effective_target_c++2a. --- gcc/doc/invoke.texi | 10 ++++++---- gcc/c-family/c.opt | 6 +++++- gcc/testsuite/lib/target-supports.exp | 9 ++++++--- 3 files changed, 17 insertions(+), 8 deletions(-) base-commit: 0b3c2eed35d608d6541ecf004a9576b4eae0b4ef diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 597151670be..3e47d06f0d5 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2078,13 +2078,15 @@ The name @samp{c++1z} is deprecated. GNU dialect of @option{-std=c++17}. The name @samp{gnu++1z} is deprecated. -@item c++2a -The next revision of the ISO C++ standard, tentatively planned for +@item c++20 +@itemx c++2a +The next revision of the ISO C++ standard, planned for 2020. Support is highly experimental, and will almost certainly change in incompatible ways in future releases. -@item gnu++2a -GNU dialect of @option{-std=c++2a}. Support is highly experimental, +@item gnu++20 +@itemx gnu++2a +GNU dialect of @option{-std=c++20}. Support is highly experimental, and will almost certainly change in incompatible ways in future releases. @end table diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 814ed17f7c4..b7e4fe146b2 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -2071,7 +2071,11 @@ Conform to the ISO 2017 C++ standard. std=c++2a C++ ObjC++ -Conform to the ISO 2020(?) C++ draft standard (experimental and incomplete support). +Conform to the ISO 2020 C++ draft standard (experimental and incomplete support). + +std=c++20 +C++ ObjC++ Alias(std=c++2a) +Conform to the ISO 2020 C++ draft standard (experimental and incomplete support). std=c11 C ObjC diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index fb177c54aa8..ec462315860 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8806,7 +8806,7 @@ proc check_effective_target_c++2a_only { } { if ![check_effective_target_c++] { return 0 } - if [check-flags { { } { } { -std=c++2a -std=gnu++2a } }] { + if [check-flags { { } { } { -std=c++2a -std=gnu++2a -std=c++20 -std=gnu++20 } }] { return 1 } if { $cxx_default == "c++20" && [check-flags { { } { } { } { -std=* } }] } { @@ -8818,9 +8818,12 @@ proc check_effective_target_c++2a { } { return [check_effective_target_c++2a_only] } -# Check for C++ Concepts TS support, i.e. -fconcepts flag. +# Check for C++ Concepts support, i.e. -fconcepts flag. proc check_effective_target_concepts { } { - return [check-flags { "" { } { -fconcepts -std=*2a } }] + if [check_effective_target_c++2a] { + return 1 + } + return [check-flags { "" { } { -fconcepts } }] } # Return 1 if expensive testcases should be run.