* [C++ Patch, obvious?] Minor decl.c clean up
@ 2017-04-26 9:50 Paolo Carlini
2017-04-26 18:52 ` Nathan Sidwell
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2017-04-26 9:50 UTC (permalink / raw)
To: gcc-patches; +Cc: Jason Merrill
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
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.
////////////////////
[-- Attachment #2: CL_CU1 --]
[-- Type: text/plain, Size: 186 bytes --]
2017-04-26 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grok_ctor_properties, ambi_op_p, unary_op_p): Change
return type to bool.
* cp-tree.h (grok_ctor_properties): Update.
[-- Attachment #3: patch_CU1 --]
[-- Type: text/plain, Size: 2299 bytes --]
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [C++ Patch, obvious?] Minor decl.c clean up
2017-04-26 9:50 [C++ Patch, obvious?] Minor decl.c clean up Paolo Carlini
@ 2017-04-26 18:52 ` Nathan Sidwell
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Sidwell @ 2017-04-26 18:52 UTC (permalink / raw)
To: Paolo Carlini, gcc-patches; +Cc: Jason Merrill
On 04/26/2017 05:19 AM, Paolo Carlini wrote:
> 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.
>
> ////////////////////
>
ok
--
Nathan Sidwell
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-26 17:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 9:50 [C++ Patch, obvious?] Minor decl.c clean up Paolo Carlini
2017-04-26 18:52 ` Nathan Sidwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).