Commit 88e451e1 by Volker Reichelt

re PR c++/12370 (wrong code when adding friend)

	PR c++/12370
	* g++.dg/other/friend2.C: New test.
	* ChangeLog: Add PR number to patch for PR c++/12370.

From-SVN: r72446
parent b71d486c
2003-10-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* ChangeLog: Add PR number to patch for PR c++/12370.
2003-10-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
Break out decl.c (2/n)
......@@ -171,6 +175,7 @@
2003-09-30 Richard Henderson <rth@redhat.com>
PR c++/12370
* decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too.
2003-09-30 Kelley Cook <kelleycoook@wideopenwest.com>
......
2003-10-13 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/12370
* g++.dg/other/friend2.C: New test.
2003-10-12 Steven Bosscher <steven@gcc.gnu.org>
* gcc.dg/20031012-1.c: New test.
......
// { dg-do run }
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// PR c++/12370
// Wrong code because of the friend declaration
template <typename T> struct A
{
T x;
A(T t) : x(t) {}
friend A<int> foo (const A<unsigned>&);
};
A<int> foo (const A<unsigned>& a)
{
A<int> res(a.x);
return res;
}
int main()
{
return foo(A<unsigned>(0)).x;
}
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