From patchwork Fri Jan 12 18:34:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 860150 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-471037-incoming=patchwork.ozlabs.org@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.b="qWD8fnxD"; 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 3zJBHN39tkz9sNc for ; Sat, 13 Jan 2018 05:34:39 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=YsOj4XPwyzdKiAgBz2jX4OEsemgHQrzcxsS/iYfCLjQsb7i33l ncjll7JHifcMVgmgulOqKaIKS1AEI3BinTAxvBQlW01/EgNO/ncluagRvjQmK2j9 zu66RhSyJT2GVPH8zE0iIGbad1bioeNHseBqVJYGzlr5ju+oc4gF1lifU= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=0H3dJagd1VqKgW24BYwoLwRBI9Q=; b=qWD8fnxDAp8JEH2VzZDI W26wTJpdlSkqUy5favWXRJhZW8yYm98gu6jDUFuzitOKMYu8iuZSTOl00fYLip44 QsTN/Qj5CZz8eTso0ioPHIH9oXh4ba0VRV1qV2E/pXOiFHNt0VwLfmRaRRHUQHgv 6swemIl+oBU4VJ9kzLiPV0w= Received: (qmail 97495 invoked by alias); 12 Jan 2018 18:34:32 -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 97477 invoked by uid 89); 12 Jan 2018 18:34:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=reformatting, 256587, friend X-HELO: mail-yb0-f170.google.com Received: from mail-yb0-f170.google.com (HELO mail-yb0-f170.google.com) (209.85.213.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 18:34:30 +0000 Received: by mail-yb0-f170.google.com with SMTP id h9so3074703ybg.10 for ; Fri, 12 Jan 2018 10:34:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=oxuBV6TLrpZhXAK+GjPeWcNCaEnj7dcFm7Yl8cU3RXE=; b=pJJfNwQApiTDPIeqLc7ixSmekQAK40wEUaRY2KzkjvjO/lhw7RjrhY7PEmI/KHulTk kWnYOkhIvDGtFSjzdIk6jJgMmJkaqUk10XTEi098rwRe89QJppflcN7vjKG086CpE6Rj dRNuchuvBNwpUA6X7l5SjFz1fCtL1wJP6sZwgtGyA2CVSN0wrr6ieeBx4pf+qLOPrpP2 lmigAJJpZSxS3ISYIDYSq1GrNsMU0Vh/MX/sVPRwPQGQ/nCC9jgsy3ZhSDgtHnxlExOv /hSddgFpn2JBrkHoZ1pJxs4/MLfHhZky1EgJdnoST9eXiR23s1S6Z4fmBczdSP5tJQbq TfbQ== X-Gm-Message-State: AKGB3mJSkMUW+kUKGkxFQLB/ZSseDzfBPEFVU2e8xmc+eXghwIBlAIcI 5Vf0jVmhjlZuOqm+nTkhS+Or5A== X-Google-Smtp-Source: ACJfBott5wyUr/J5o8IQ5sXwcFM56EyqOfSL/A2gbnxOiF1d9XU+CVwgPrxC/lxKDkPsPCveekAShw== X-Received: by 10.37.139.11 with SMTP id i11mr24198028ybl.510.1515782069033; Fri, 12 Jan 2018 10:34:29 -0800 (PST) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::2:3141]) by smtp.googlemail.com with ESMTPSA id n3sm1673384ywb.53.2018.01.12.10.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 10:34:28 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] some reformatting Message-ID: Date: Fri, 12 Jan 2018 13:34:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In working on pr83160 I came across some code to cleanup 1) name mark_rvalue_use's final parm to remind us what it is 2) fix poor line breaking in convert_like_real 3) move mark_lvalue_use{,_nonread) close to their friend mark_rvalue_use applying to trunk. nathan 2018-01-12 Nathan Sidwell * cp-tree.h (mark_rvalue_use): Add parm name. * expr.c (mark_lvalue_use, mark_lvalue_use_nonread): Move next to mark_rvalue_use. * call.c (convert_like_real): Fix formatting. Index: cp/call.c =================================================================== --- cp/call.c (revision 256587) +++ cp/call.c (working copy) @@ -6890,9 +6890,9 @@ convert_like_real (conversion *convs, tr }; expr = convert_like_real (next_conversion (convs), expr, fn, argnum, - convs->kind == ck_ref_bind ? issue_conversion_warnings : false, - c_cast_p, - complain); + convs->kind == ck_ref_bind + ? issue_conversion_warnings : false, + c_cast_p, complain); if (expr == error_mark_node) return error_mark_node; Index: cp/cp-tree.h =================================================================== --- cp/cp-tree.h (revision 256587) +++ cp/cp-tree.h (working copy) @@ -6330,7 +6330,7 @@ extern tree create_try_catch_expr extern tree cplus_expand_constant (tree); extern tree mark_rvalue_use (tree, location_t = UNKNOWN_LOCATION, - bool = true); + bool reject_builtin = true); extern tree mark_lvalue_use (tree); extern tree mark_lvalue_use_nonread (tree); extern tree mark_type_use (tree); @@ -6341,7 +6341,8 @@ extern void mark_exp_read (tree); extern int is_friend (tree, tree); extern void make_friend_class (tree, tree, bool); extern void add_friend (tree, tree, bool); -extern tree do_friend (tree, tree, tree, tree, enum overload_flags, bool); +extern tree do_friend (tree, tree, tree, tree, + enum overload_flags, bool); extern void set_global_friend (tree); extern bool is_global_friend (tree); Index: cp/expr.c =================================================================== --- cp/expr.c (revision 256587) +++ cp/expr.c (working copy) @@ -199,6 +199,22 @@ mark_rvalue_use (tree e, return mark_use (e, true, true, loc, reject_builtin); } +/* Called whenever an expression is used in an lvalue context. */ + +tree +mark_lvalue_use (tree expr) +{ + return mark_use (expr, false, true, input_location, false); +} + +/* As above, but don't consider this use a read. */ + +tree +mark_lvalue_use_nonread (tree expr) +{ + return mark_use (expr, false, false, input_location, false); +} + /* Called when expr appears as a discarded-value expression. */ tree @@ -245,22 +261,6 @@ mark_discarded_use (tree expr) return mark_use (expr, true, true, input_location, false); } -/* Called whenever an expression is used in an lvalue context. */ - -tree -mark_lvalue_use (tree expr) -{ - return mark_use (expr, false, true, input_location, false); -} - -/* As above, but don't consider this use a read. */ - -tree -mark_lvalue_use_nonread (tree expr) -{ - return mark_use (expr, false, false, input_location, false); -} - /* Called whenever an expression is used in a type use context. */ tree