public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c++: remove single-parameter version of mark_used
@ 2022-06-07 14:16 Patrick Palka
  2022-06-07 18:05 ` Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2022-06-07 14:16 UTC (permalink / raw)
  To: gcc-patches

gcc/cp/ChangeLog:

	* cp-tree.h (mark_used): Remove single-parameter overload.  Add
	default argument to the two-parameter overload.
	* decl2.cc (mark_used): Likewise.
---
 gcc/cp/cp-tree.h | 3 +--
 gcc/cp/decl2.cc  | 8 +-------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index cc13809f38a..ac5b3eef118 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -6932,8 +6932,7 @@ extern bool decl_constant_var_p			(tree);
 extern bool decl_maybe_constant_var_p		(tree);
 extern void no_linkage_error			(tree);
 extern void check_default_args			(tree);
-extern bool mark_used				(tree);
-extern bool mark_used			        (tree, tsubst_flags_t);
+extern bool mark_used			        (tree, tsubst_flags_t = tf_warning_or_error);
 extern bool mark_single_function	        (tree, tsubst_flags_t);
 extern void finish_static_data_member_decl	(tree, tree, bool, tree, int);
 extern tree cp_build_parm_decl			(tree, tree, tree);
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc
index 974afe798b6..f15381be5f1 100644
--- a/gcc/cp/decl2.cc
+++ b/gcc/cp/decl2.cc
@@ -5730,7 +5730,7 @@ mark_single_function (tree expr, tsubst_flags_t complain)
    wrong, true otherwise.  */
 
 bool
-mark_used (tree decl, tsubst_flags_t complain)
+mark_used (tree decl, tsubst_flags_t complain /* = tf_warning_or_error */)
 {
   /* If we're just testing conversions or resolving overloads, we
      don't want any permanent effects like forcing functions to be
@@ -5974,12 +5974,6 @@ mark_used (tree decl, tsubst_flags_t complain)
   return true;
 }
 
-bool
-mark_used (tree decl)
-{
-  return mark_used (decl, tf_warning_or_error);
-}
-
 tree
 vtv_start_verification_constructor_init_function (void)
 {
-- 
2.36.1.299.gab336e8f1c


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] c++: remove single-parameter version of mark_used
  2022-06-07 14:16 [PATCH] c++: remove single-parameter version of mark_used Patrick Palka
@ 2022-06-07 18:05 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2022-06-07 18:05 UTC (permalink / raw)
  To: Patrick Palka, gcc-patches

On 6/7/22 10:16, Patrick Palka wrote:
> gcc/cp/ChangeLog:
> 
> 	* cp-tree.h (mark_used): Remove single-parameter overload.  Add
> 	default argument to the two-parameter overload.
> 	* decl2.cc (mark_used): Likewise.

OK.

> ---
>   gcc/cp/cp-tree.h | 3 +--
>   gcc/cp/decl2.cc  | 8 +-------
>   2 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
> index cc13809f38a..ac5b3eef118 100644
> --- a/gcc/cp/cp-tree.h
> +++ b/gcc/cp/cp-tree.h
> @@ -6932,8 +6932,7 @@ extern bool decl_constant_var_p			(tree);
>   extern bool decl_maybe_constant_var_p		(tree);
>   extern void no_linkage_error			(tree);
>   extern void check_default_args			(tree);
> -extern bool mark_used				(tree);
> -extern bool mark_used			        (tree, tsubst_flags_t);
> +extern bool mark_used			        (tree, tsubst_flags_t = tf_warning_or_error);
>   extern bool mark_single_function	        (tree, tsubst_flags_t);
>   extern void finish_static_data_member_decl	(tree, tree, bool, tree, int);
>   extern tree cp_build_parm_decl			(tree, tree, tree);
> diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc
> index 974afe798b6..f15381be5f1 100644
> --- a/gcc/cp/decl2.cc
> +++ b/gcc/cp/decl2.cc
> @@ -5730,7 +5730,7 @@ mark_single_function (tree expr, tsubst_flags_t complain)
>      wrong, true otherwise.  */
>   
>   bool
> -mark_used (tree decl, tsubst_flags_t complain)
> +mark_used (tree decl, tsubst_flags_t complain /* = tf_warning_or_error */)
>   {
>     /* If we're just testing conversions or resolving overloads, we
>        don't want any permanent effects like forcing functions to be
> @@ -5974,12 +5974,6 @@ mark_used (tree decl, tsubst_flags_t complain)
>     return true;
>   }
>   
> -bool
> -mark_used (tree decl)
> -{
> -  return mark_used (decl, tf_warning_or_error);
> -}
> -
>   tree
>   vtv_start_verification_constructor_init_function (void)
>   {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-07 18:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-07 14:16 [PATCH] c++: remove single-parameter version of mark_used Patrick Palka
2022-06-07 18:05 ` Jason Merrill

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).