From patchwork Tue Aug 13 13:36:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1146368 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-506819-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="Rcs9y3A2"; 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 467DJq0W1zz9sDQ for ; Tue, 13 Aug 2019 23:36:41 +1000 (AEST) 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:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=m9Djqqa9B+De+IInj SCvDxPdvZW/29JxUi5BCf6JANjANoMKotR4jdNVpHXl5IxCfXABBwBApWIo/JMTR JFszj0Pj5sEnBvPt6ksHBYDD3Zf2tFITHQlsnUKlXjliapEfVd5r+/RjJ5LlL8ze VkAPaSjwCkpguACh67qdAJcBww= 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:references:mime-version :content-type:in-reply-to; s=default; bh=jrG0QtlOQd3dQyA+MXJkCr8 nQII=; b=Rcs9y3A2B9hoUvzuZ5x90wf1OFFvLFzckXH6dziDvoiuQalj4NtiBin c8tLPRoPmzEQmmZjxWh0xzB/6Uu5q8+/kmrEOoVz4U3NtAk/4YFqVDqTTzrEysGA U8prl5MJzIqQSzy6l+OfS5PXrl+FXmC1USYA7X2okcDwHqbSJTL4= Received: (qmail 119804 invoked by alias); 13 Aug 2019 13:36:34 -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 119495 invoked by uid 89); 13 Aug 2019 13:36:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Aug 2019 13:36:32 +0000 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 mx1.redhat.com (Postfix) with ESMTPS id 68D408E59F; Tue, 13 Aug 2019 13:36:31 +0000 (UTC) Received: from localhost (unknown [10.33.36.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C70E7EF45; Tue, 13 Aug 2019 13:36:30 +0000 (UTC) Date: Tue, 13 Aug 2019 14:36:30 +0100 From: Jonathan Wakely To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Nathan Sidwell , David Malcolm Subject: [PATCH 2/2] Add more entries to the C++ get_std_name_hint array Message-ID: <20190813133630.GG9487@redhat.com> References: <20190813133217.GA11146@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190813133217.GA11146@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.0 (2019-05-25) This adds some commonly-used C++11/14 names, and some new C++17/20 names. The latter aren't available when using the -std=gnu++14 default, so the fix-it suggesting to use a newer dialect is helpful. * name-lookup.c (get_std_name_hint): Add more entries. Tested x86_64-linux. OK for trunk? commit 0c12d092e5659689951b5e134b84c5b506b543d5 Author: Jonathan Wakely Date: Tue Aug 13 13:42:40 2019 +0100 Add more entries to the C++ get_std_name_hint array * name-lookup.c (get_std_name_hint): Add more entries. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 96b2d90540d..68ebd7655c7 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5550,9 +5550,11 @@ get_std_name_hint (const char *name) {"make_any", "", cxx17}, /* . */ {"array", "", cxx11}, + {"to_array", "", cxx2a}, /* . */ {"atomic", "", cxx11}, {"atomic_flag", "", cxx11}, + {"atomic_ref", "", cxx2a}, /* . */ {"bitset", "", cxx11}, /* . */ @@ -5575,9 +5577,17 @@ get_std_name_hint (const char *name) {"ofstream", "", cxx98}, /* . */ {"bind", "", cxx11}, + {"bind_front", "", cxx2a}, {"function", "", cxx11}, {"hash", "", cxx11}, + {"invoke", "", cxx17}, {"mem_fn", "", cxx11}, + {"not_fn", "", cxx17}, + {"reference_wrapper", "", cxx11}, + {"unwrap_reference", "", cxx2a}, + {"unwrap_reference_t", "", cxx2a}, + {"unwrap_ref_decay", "", cxx2a}, + {"unwrap_ref_decay_t", "", cxx2a}, /* . */ {"async", "", cxx11}, {"future", "", cxx11}, @@ -5618,11 +5628,16 @@ get_std_name_hint (const char *name) {"map", "", cxx98}, {"multimap", "", cxx98}, /* . */ + {"allocate_shared", "", cxx11}, + {"allocator", "", cxx98}, + {"allocator_traits", "", cxx11}, {"make_shared", "", cxx11}, {"make_unique", "", cxx14}, {"shared_ptr", "", cxx11}, {"unique_ptr", "", cxx11}, {"weak_ptr", "", cxx11}, + /* . */ + {"pmr", "", cxx17}, /* . */ {"mutex", "", cxx11}, {"timed_mutex", "", cxx11}, @@ -5672,14 +5687,39 @@ get_std_name_hint (const char *name) {"u16string", "", cxx11}, {"u32string", "", cxx11}, /* . */ + {"basic_string_view", "", cxx17}, {"string_view", "", cxx17}, /* . */ {"thread", "", cxx11}, + {"this_thread", "", cxx11}, /* . */ + {"apply", "", cxx17}, + {"forward_as_tuple", "", cxx11}, + {"make_from_tuple", "", cxx17}, {"make_tuple", "", cxx11}, + {"tie", "", cxx11}, {"tuple", "", cxx11}, + {"tuple_cat", "", cxx11}, {"tuple_element", "", cxx11}, + {"tuple_element_t", "", cxx14}, {"tuple_size", "", cxx11}, + {"tuple_size_v", "", cxx17}, + /* . */ + {"enable_if", "", cxx11}, + {"enable_if_t", "", cxx14}, + {"invoke_result", "", cxx17}, + {"invoke_result_t", "", cxx17}, + {"remove_cvref", "", cxx17}, + {"remove_cvref_t", "", cxx17}, + {"type_identity", "", cxx2a}, + {"type_identity_t", "", cxx2a}, + {"void_t", "", cxx17}, + {"conjunction", "", cxx17}, + {"conjunction_v", "", cxx17}, + {"disjunction", "", cxx17}, + {"disjunction_v", "", cxx17}, + {"negation", "", cxx17}, + {"negation_v", "", cxx17}, /* . */ {"unordered_map", "", cxx11}, {"unordered_multimap", "", cxx11},