Commit aad626f7 by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

re PR c++/11616 (Error message "instantiated from here" gives wrong location)

	PR c++/11616
	* pt.c (instantiate_pending_templates): Save and restore
	input_location.

	* g++.dg/template/instantiate5.C: New test.

From-SVN: r73269
parent 437a91e6
2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/11616
* pt.c (instantiate_pending_templates): Save and restore
input_location.
2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/2019 PR c++/2019
* friend.c (add_friend): Don't display previous declaration in * friend.c (add_friend): Don't display previous declaration in
case of duplicate friend warning. case of duplicate friend warning.
......
...@@ -11037,6 +11037,7 @@ instantiate_pending_templates (void) ...@@ -11037,6 +11037,7 @@ instantiate_pending_templates (void)
tree last = NULL_TREE; tree last = NULL_TREE;
int instantiated_something = 0; int instantiated_something = 0;
int reconsider; int reconsider;
location_t saved_loc = input_location;
do do
{ {
...@@ -11111,6 +11112,7 @@ instantiate_pending_templates (void) ...@@ -11111,6 +11112,7 @@ instantiate_pending_templates (void)
} }
while (reconsider); while (reconsider);
input_location = saved_loc;
return instantiated_something; return instantiated_something;
} }
......
2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/11616
* g++.dg/template/instantiate5.C: New test.
2003-11-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2003-11-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/12726 PR c++/12726
......
// { dg-do compile }
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
// PR c++/11616: Incorrect line number in diagnostics
template <int> struct A
{
static const int i=0;
};
int baz() { return A<0>::i; }
struct B
{
static void foo (int); // { dg-error "candidates" }
};
template <typename T> struct C
{
virtual void bar() const { T::foo(); } // { dg-error "no matching function" }
};
C<B> c; // { dg-error "instantiated" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment