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]

[C++ PATCH,committed] Fix PR12796 (wrong line number in invalidusing decl error)


Hi

An error message for class scoped using declaration isn't displayed with
correct line number.  The patch below fixes this.  It is applied to
mainline as obvious.  Tested on i686-pc-linux-gnu.

--Kriang


2003-11-01  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	PR c++/12796
	* class.c (handle_using_decl): Set input_location before calling
	error_not_base_type.


*** gcc-main-save/gcc/cp/class.c	Fri Oct 24 21:45:58 2003
--- gcc-main-new/gcc/cp/class.c	Sat Nov  1 00:09:51 2003
*************** handle_using_decl (tree using_decl, tree
*** 1109,1115 ****
--- 1109,1119 ----
    binfo = lookup_base (t, ctype, ba_any, NULL);
    if (! binfo)
      {
+       location_t saved_loc = input_location;
+ 
+       input_location = DECL_SOURCE_LOCATION (using_decl);
        error_not_base_type (ctype, t);
+       input_location = saved_loc;
        return;
      }
    


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