[C++] some reformatting

Message ID a797a55c-4379-d0d2-98fb-e5f9c0d7f389@acm.org
State New
Headers show
Series
  • [C++] some reformatting
Related show

Commit Message

Nathan Sidwell Jan. 12, 2018, 6:34 p.m.
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

Patch

2018-01-12  Nathan Sidwell  <nathan@acm.org>

	* 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