[PATCH c++/31665] Move the fragments of conditional expressions to full sentences

Paolo Bonzini bonzini@gnu.org
Wed Dec 16 12:37:00 GMT 2009


On 12/16/2009 10:55 AM, Shujing Zhao wrote:
> @@ -3934,9 +3936,9 @@ check_tag_decl (cp_decl_specifier_seq *d
>      {
>        if (declspecs->specs[(int)ds_inline]
>  	  || declspecs->specs[(int)ds_virtual])
> -	error ("%qs can only be specified for functions",
> -	       declspecs->specs[(int)ds_inline]
> -	       ? "inline" : "virtual");
> +	error (declspecs->specs[(int)ds_inline]
> +	       ? G_("%<inline%> can only be specified for functions")
> +               : G_("%<virtual%> can only be specified for functions"));
>        else if (saw_friend
>  	       && (!current_class_type
>  		   || current_scope () != current_class_type))
>
> @@ -19808,10 +19809,13 @@ static void
>   cp_parser_check_class_key (enum tag_types class_key, tree type)
>   {
>     if ((TREE_CODE (type) == UNION_TYPE) != (class_key == union_type))
> -    permerror (input_location, "%qs tag used in naming %q#T",
> -	    class_key == union_type ? "union"
> -	     : class_key == record_type ? "struct" : "class",
> -	     type);
> +    permerror (input_location,
> +               class_key == union_type
> +               ? G_("%<union%>  tag used in naming %q#T")
> +               : class_key == record_type
> +                 ? G_("%<struct%>  tag used in naming %q#T")
> +                 : G_("%<class%>  tag used in naming %q#T"),
> +	       type);
>   }

Pedantically these are not needed, because keywords are not translated 
anyway (and it gives 3 more strings to translate).  However, I don't 
think this is a problem.

Paolo



More information about the Gcc-patches mailing list