Commit 80cdd94a by Volker Reichelt Committed by Volker Reichelt

re PR c++/27547 (ICE on invalid operator=)

	PR c++/27547
	* decl.c (copy_fn_p): Return early on non-member functions.

	* g++.dg/other/operator1.C: New test.

From-SVN: r113696
parent c6c097b2
2006-05-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27547
* decl.c (copy_fn_p): Return early on non-member functions.
2006-05-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-05-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27447 PR c++/27447
......
...@@ -8818,7 +8818,9 @@ copy_fn_p (tree d) ...@@ -8818,7 +8818,9 @@ copy_fn_p (tree d)
tree arg_type; tree arg_type;
int result = 1; int result = 1;
gcc_assert (DECL_FUNCTION_MEMBER_P (d)); if (!DECL_FUNCTION_MEMBER_P (d))
/* Non-members are invalid. We complained, but kept the declaration. */
return 0;
if (TREE_CODE (d) == TEMPLATE_DECL if (TREE_CODE (d) == TEMPLATE_DECL
|| (DECL_TEMPLATE_INFO (d) || (DECL_TEMPLATE_INFO (d)
......
2006-05-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27547
* g++.dg/other/operator1.C: New test.
2006-05-11 Richard Guenther <rguenther@suse.de> 2006-05-11 Richard Guenther <rguenther@suse.de>
PR middle-end/27529 PR middle-end/27529
// PR c++/27547
// { dg-do compile }
int operator=(int); // { dg-error "member function" }
void foo()
{
operator=(0);
}
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