This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix PR c++/27547: ICE on invalid operator=
On 11 May, Nathan Sidwell wrote:
> Volker Reichelt wrote:
>
>>
>> 2006-05-11 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
>>
>> PR c++/27547
>> * decl.c (copy_fn_p): Return early on non-member functions.
> ok. please add a comment explaining why we might get there with a non-member.
>
> nathan
Like so?
===================================================================
--- gcc/gcc/cp/decl.c (revision 113669)
+++ gcc/gcc/cp/decl.c (working copy)
@@ -8818,7 +8818,9 @@ copy_fn_p (tree d)
tree arg_type;
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
|| (DECL_TEMPLATE_INFO (d)
===================================================================
Regards,
Volker