[4/5] c++/reflection: Fix wrong function name in error messages

Message ID 20260407110826.8427-4-yangkun@disroot.org
State New
Headers
Series [1/5] c++: gcc_assert(false) replaced with gcc_unreachable() |

Commit Message

yangkun April 7, 2026, 11:08 a.m. UTC
  gcc/cp/ChangeLog:
	* reflect.cc (eval_display_string_of): Fix copy-paste error in exception
	messages.
---
 gcc/cp/reflect.cc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Jakub Jelinek April 7, 2026, 3:50 p.m. UTC | #1
On Tue, Apr 07, 2026 at 07:08:25PM +0800, Yang Kun wrote:
> gcc/cp/ChangeLog:
> 	* reflect.cc (eval_display_string_of): Fix copy-paste error in exception
> 	messages.
> ---
>  gcc/cp/reflect.cc | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc
> index 71573d27f..1f8a7800f 100644
> --- a/gcc/cp/reflect.cc
> +++ b/gcc/cp/reflect.cc
> @@ -3702,13 +3702,14 @@ eval_display_string_of (location_t loc, const constexpr_ctx *ctx, tree r,
>    if (str == NULL_TREE)
>      {
>        if (elt_type == char_type_node)
> -	return throw_exception (loc, ctx, "identifier_of not representable"
> +	return throw_exception (loc, ctx, "display_string_of not representable"
>  					  " in ordinary literal encoding",
>  				fun, non_constant_p, jump_target);
>        else
> -	return throw_exception (loc, ctx, "u8identifier_of not representable"
> -					  " in UTF-8", fun, non_constant_p,
> -					  jump_target);
> +	return throw_exception (loc, ctx,
> +				"u8display_string_of not representable"
> +				" in UTF-8",
> +				fun, non_constant_p, jump_target);
>      }
>    releasing_vec args (make_tree_vector_single (str));
>    tree ret = build_special_member_call (NULL_TREE, complete_ctor_identifier,

LGTM, but same legal question applies.

	Jakub
  

Patch

diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc
index 71573d27f..1f8a7800f 100644
--- a/gcc/cp/reflect.cc
+++ b/gcc/cp/reflect.cc
@@ -3702,13 +3702,14 @@  eval_display_string_of (location_t loc, const constexpr_ctx *ctx, tree r,
   if (str == NULL_TREE)
     {
       if (elt_type == char_type_node)
-	return throw_exception (loc, ctx, "identifier_of not representable"
+	return throw_exception (loc, ctx, "display_string_of not representable"
 					  " in ordinary literal encoding",
 				fun, non_constant_p, jump_target);
       else
-	return throw_exception (loc, ctx, "u8identifier_of not representable"
-					  " in UTF-8", fun, non_constant_p,
-					  jump_target);
+	return throw_exception (loc, ctx,
+				"u8display_string_of not representable"
+				" in UTF-8",
+				fun, non_constant_p, jump_target);
     }
   releasing_vec args (make_tree_vector_single (str));
   tree ret = build_special_member_call (NULL_TREE, complete_ctor_identifier,