mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 14:21:20 +08:00
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
This commit is contained in:
parent
c6c097b26c
commit
80cdd94a6c
gcc
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR c++/27447
|
||||
|
@ -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)
|
||||
|
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
PR middle-end/27529
|
||||
|
9
gcc/testsuite/g++.dg/other/operator1.C
Normal file
9
gcc/testsuite/g++.dg/other/operator1.C
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/27547
|
||||
// { dg-do compile }
|
||||
|
||||
int operator=(int); // { dg-error "member function" }
|
||||
|
||||
void foo()
|
||||
{
|
||||
operator=(0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user