From patchwork Fri Dec 6 20:20:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1205277 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-515377-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="PhQBnPOh"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="WqtkSK6o"; 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 47V3qT3JNkz9sR1 for ; Sat, 7 Dec 2019 07:20:18 +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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=NG2 ERXWAWxtiGCsEB282sKU3sAuSudKCzsU8o7/g6Ce1HjFCxLLiGU2044fU/KgGHoV QbdrDijLo1MRv9mBSZrME3yrBKGJSrkLS8mFqpjKdhd+NpN8f7unRlzyhi6K9Y18 3hpACgcxc3AfnnFLje4qS+dhwP57FSdnh7UZIrYA= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type:content-transfer-encoding; s=default; bh=Sdm5Sn+nD itiHWtGwOlEj9RbhP8=; b=PhQBnPOhzKX8xHuhqmCyNiGUTH7lAw7BDprOXT4TN v6mlLDeoPtqZxSTED4Fx7xabxJtXVVFrCssfv/wi29OPvsfouLk9teh4LlN+2cjs mvy4IbbKGSmWdDWbX79UkhijbO86TZlYpSM6sl7adRyBw1FWH06d89oCg1q6hYKZ Yo= Received: (qmail 9354 invoked by alias); 6 Dec 2019 20:20:10 -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 9346 invoked by uid 89); 6 Dec 2019 20:20:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=timeframe X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Dec 2019 20:20:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575663607; h=from:from:reply-to: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=iJLfTSWq9PePynbQcQCzOVkeo27Bi3K3TZA0F7QBxSE=; b=WqtkSK6oBxcRnRbLA7rCmkCntRGshOkWZScJnSXjHvMtkIZExTHOMUNTLIVOaXxpWWWzVi Nqb13m3wDfW67WHQg97R4ta1KYpHJEa9xHhtYx5OusfKNJkFZb69YWoJOvd1YaqVQW9nwa w+zYAubL1JqKDQkaIupioiUrcxrq4kM= 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-376-31CwUPt2MT2SLh5m-4l0xA-1; Fri, 06 Dec 2019 15:20:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8AD0C10626F9 for ; Fri, 6 Dec 2019 20:20:05 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-59.ams2.redhat.com [10.36.117.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 22ED660176; Fri, 6 Dec 2019 20:20:03 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id xB6KK1W0018241; Fri, 6 Dec 2019 21:20:02 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id xB6KK0pp018240; Fri, 6 Dec 2019 21:20:00 +0100 Date: Fri, 6 Dec 2019 21:20:00 +0100 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [C++ PATCH] Tweak concept diagnostics Message-ID: <20191206202000.GI10088@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 Content-Disposition: inline X-IsSubscribed: yes Hi! I've noticed that while for requires keyword we have a diagnostics like error_at (cp_lexer_peek_token (parser->lexer)->location, "% only available with " "%<-std=c++2a%> or %<-fconcepts%>"); for concept keyword we emit inform (location, "% only available with %<-fconcepts%>"); The following patch adjusts the latter to match the former, because I think more people will use -std=c++2a than -fconcepts in the GCC 10 timeframe. Tested on x86_64-linux, ok for trunk? 2019-12-06 Jakub Jelinek * parser.c (cp_parser_diagnose_invalid_type_name): Mention that concept is also available with -std=c++2a. Jakub --- gcc/cp/parser.c.jj 2019-12-05 10:03:04.072181899 +0100 +++ gcc/cp/parser.c 2019-12-06 19:40:44.090311079 +0100 @@ -3367,7 +3367,8 @@ cp_parser_diagnose_invalid_type_name (cp inform (location, "C++20 % only available with " "%<-std=c++2a%> or %<-std=gnu++2a%>"); else if (!flag_concepts && id == ridpointers[(int)RID_CONCEPT]) - inform (location, "% only available with %<-fconcepts%>"); + inform (location, "% only available with %<-std=c++2a%> or " + "%<-fconcepts%>"); else if (processing_template_decl && current_class_type && TYPE_BINFO (current_class_type)) {