This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH,committed] Fix PR12796 (wrong line number in invalidusing decl error)
- From: Kriang Lerdsuwanakij <lerdsuwa at users dot sourceforge dot net>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 1 Nov 2003 19:04:39 +0700 (ICT)
- Subject: [C++ PATCH,committed] Fix PR12796 (wrong line number in invalidusing decl error)
- Reply-to: <lerdsuwa at users dot sourceforge dot net>
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;
}