From patchwork Wed Apr 26 09:19:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 755319 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wCZL30QXkz9s89 for ; Wed, 26 Apr 2017 19:20:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DYCDQxOp"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ZdRb+zqmN6NN5+XMCGGJpjJQBn+qSpcrBnceQ/viY5bkGeHmhG Fhx2Si5XbkJaqZ5p/ZTJRdR2LsiXM1HD05mmT4opkiGKvvBHQVA9p5034FMf8LKZ RLFK/D4B6WfLK2/t/EujflsM+fV1nnQrWSFMFQrZiKCVnbLYh3uZk8QGk= 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:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=vTe07+KIfAI8QRMjZH4Gs81Z1KQ=; b=DYCDQxOpD7HxBTcKBYLo QVLKkZe9dq793Ve32Mj8yPsXClxuHbeiuwS3KPmAOY3ijYU+V9GQkZoOxDj8DpHD +hoA7rsReoL174BCUxx9pcTMdDCwvb/3S5810Yh2Z1qAruNXImIlMQhWN2P3NwWj aBIZVkjUHP8R4l2mmSJgJGk= Received: (qmail 129586 invoked by alias); 26 Apr 2017 09:19:17 -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 129495 invoked by uid 89); 26 Apr 2017 09:19:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Apr 2017 09:19:14 +0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v3Q9JE6h026004 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Apr 2017 09:19:14 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v3Q9JEPI021413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Apr 2017 09:19:14 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v3Q9JEx8013972; Wed, 26 Apr 2017 09:19:14 GMT Received: from [192.168.1.4] (/87.20.193.125) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Apr 2017 02:19:13 -0700 To: "gcc-patches@gcc.gnu.org" Cc: Jason Merrill From: Paolo Carlini Subject: [C++ Patch, obvious?] Minor decl.c clean up Message-ID: Date: Wed, 26 Apr 2017 11:19:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, while working on some fixes not suited for 7.1.0 I noticed a couple of nits. This is the first one. Thanks, Paolo. //////////////////// 2017-04-26 Paolo Carlini * decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change return type to bool. * cp-tree.h (grok_ctor_properties): Update. Index: cp-tree.h =================================================================== --- cp-tree.h (revision 247273) +++ cp-tree.h (working copy) @@ -5860,7 +5860,7 @@ extern bool move_fn_p (c extern bool move_signature_fn_p (const_tree); extern tree get_scope_of_declarator (const cp_declarator *); extern void grok_special_member_properties (tree); -extern int grok_ctor_properties (const_tree, const_tree); +extern bool grok_ctor_properties (const_tree, const_tree); extern bool grok_op_properties (tree, bool); extern tree xref_tag (enum tag_types, tree, tag_scope, bool); extern tree xref_tag_from_type (tree, tree, tag_scope); Index: decl.c =================================================================== --- decl.c (revision 247273) +++ decl.c (working copy) @@ -64,8 +64,8 @@ static const char *redeclaration_error_message (tr static int decl_jump_unsafe (tree); static void require_complete_types_for_parms (tree); -static int ambi_op_p (enum tree_code); -static int unary_op_p (enum tree_code); +static bool ambi_op_p (enum tree_code); +static bool unary_op_p (enum tree_code); static void push_local_name (tree); static tree grok_reference_init (tree, tree, tree, int); static tree grokvardecl (tree, tree, tree, const cp_decl_specifier_seq *, @@ -12907,7 +12907,7 @@ grok_special_member_properties (tree decl) /* Check a constructor DECL has the correct form. Complains if the class has a constructor of the form X(X). */ -int +bool grok_ctor_properties (const_tree ctype, const_tree decl) { int ctor_parm = copy_fn_p (decl); @@ -12931,15 +12931,15 @@ grok_ctor_properties (const_tree ctype, const_tree instantiated, but that's hard to forestall. */ error ("invalid constructor; you probably meant %<%T (const %T&)%>", ctype, ctype); - return 0; + return false; } - return 1; + return true; } /* An operator with this code is unary, but can also be binary. */ -static int +static bool ambi_op_p (enum tree_code code) { return (code == INDIRECT_REF @@ -12952,7 +12952,7 @@ ambi_op_p (enum tree_code code) /* An operator with this name can only be unary. */ -static int +static bool unary_op_p (enum tree_code code) { return (code == TRUTH_NOT_EXPR