This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/8316, 9315, 10136


On Wed, 19 Mar 2003 18:40:38 -0800, Zack Weinberg <zack at codesourcery dot com> wrote:

> The correct change is to make print_z_candidate's first argument be
> named "msgid".  That will cause exgettext to notice the strings
> automatically.  You have to put it in the prototype too,

Done:

2003-03-25  Jason Merrill  <jason at redhat dot com>

	* call.c (print_z_candidate): Change name of first arg to msgid.
	(joust): Add comment for translators.

Index: call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.372
diff -c -p -r1.372 call.c
*** call.c	22 Mar 2003 15:34:38 -0000	1.372
--- call.c	25 Mar 2003 20:29:52 -0000
*************** static void op_error (enum tree_code, en
*** 56,61 ****
--- 56,63 ----
  static tree build_object_call (tree, tree);
  static tree resolve_args (tree);
  static struct z_candidate *build_user_type_conversion_1 (tree, tree, int);
+ static void print_z_candidate (const char *msgid, struct z_candidate *,
+ 			       void (*)(const char *, ...));
  static void print_z_candidates (struct z_candidate *);
  static tree build_this (tree);
  static struct z_candidate *splice_viable (struct z_candidate *, bool, bool *);
*************** equal_functions (tree fn1, tree fn2)
*** 2440,2467 ****
     (i.e. error, warning or pedwarn) used to do the printing.  */
  
  static void
! print_z_candidate (const char *str, struct z_candidate *candidate,
  		   void (*errfn)(const char *, ...))
  {
    if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE)
      {
        if (TREE_VEC_LENGTH (candidate->convs) == 3)
! 	errfn ("%s %D(%T, %T, %T) <built-in>", str, candidate->fn,
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)),
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 1)),
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 2)));
        else if (TREE_VEC_LENGTH (candidate->convs) == 2)
! 	errfn ("%s %D(%T, %T) <built-in>", str, candidate->fn,
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)),
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 1)));
        else
! 	errfn ("%s %D(%T) <built-in>", str, candidate->fn,
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)));
      }
    else if (TYPE_P (candidate->fn))
!     errfn ("%s %T <conversion>", str, candidate->fn);
    else
!     errfn ("%H%s %+#D%s", &DECL_SOURCE_LOCATION (candidate->fn), str,
  	   candidate->fn, candidate->viable == -1 ? " <near match>" : "");
  }
  
--- 2442,2469 ----
     (i.e. error, warning or pedwarn) used to do the printing.  */
  
  static void
! print_z_candidate (const char *msgid, struct z_candidate *candidate,
  		   void (*errfn)(const char *, ...))
  {
    if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE)
      {
        if (TREE_VEC_LENGTH (candidate->convs) == 3)
! 	errfn ("%s %D(%T, %T, %T) <built-in>", msgid, candidate->fn,
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)),
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 1)),
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 2)));
        else if (TREE_VEC_LENGTH (candidate->convs) == 2)
! 	errfn ("%s %D(%T, %T) <built-in>", msgid, candidate->fn,
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)),
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 1)));
        else
! 	errfn ("%s %D(%T) <built-in>", msgid, candidate->fn,
  	       TREE_TYPE (TREE_VEC_ELT (candidate->convs, 0)));
      }
    else if (TYPE_P (candidate->fn))
!     errfn ("%s %T <conversion>", msgid, candidate->fn);
    else
!     errfn ("%H%s %+#D%s", &DECL_SOURCE_LOCATION (candidate->fn), msgid,
  	   candidate->fn, candidate->viable == -1 ? " <near match>" : "");
  }
  
*************** tweak:
*** 5873,5878 ****
--- 5875,5882 ----
  	  if (warn)
  	    {
  	      print_z_candidate ("ISO C++ says that ", w, pedwarn);
+ 	      /* Translators note: This message is a continuation of the
+ 	         previous one, aligned on the right.  */
  	      print_z_candidate ("              and ", l, pedwarn);
  	      pedwarn ("are ambiguous even though the worst conversion \
  for the former is better than the worst conversion for the latter");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]