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]

RFC: PATCH to diagnostic.c:text_specifies_location


I was just changing print_z_candidates in the C++ frontend to use %H, which
produced a new failure in the testsuite: g++.old-deja/g++.other/new2.C
displays as a candidate a built-in declaration for operator new.  The old
cp_error_at code displayed it as being at <internal>:19, which doesn't make
much sense, but satisfied the test harness.  Using %H, it is displayed at
<internal>:0, which makes more sense, but breaks the old-deja testsuite and
isn't terribly useful.

The patch below causes us to ignore a location_t that specifies line 0;
instead we will just use the current file and line in the error message.
Do people think this is a good idea, or is it more useful to explicitly
tell the user that the declaration is a builtin?  I'm actually leaning a
bit towards the latter now.  The dg harness can handle messages at line 0.

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

	* diagnostic.c (text_specifies_location): Ignore the locus for an
	internal declaration.

*** diagnostic.c.~1~	2003-02-12 15:16:24.000000000 -0500
--- diagnostic.c	2003-03-19 12:37:33.000000000 -0500
*************** text_specifies_location (text, locus)
*** 801,807 ****
      {
        *locus = *va_arg (*text->args_ptr, location_t *);
        text->format_spec = p + 1;
!       return true;
      }
  
    return false;
--- 801,809 ----
      {
        *locus = *va_arg (*text->args_ptr, location_t *);
        text->format_spec = p + 1;
! 
!       /* Ignore the locus for an internal declaration.  */
!       return (locus->line != 0);
      }
  
    return false;

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