re PR c++/28258 (ICE with invalid constructor)

PR c++/28258
	* method.c (locate_copy): Check for non_reference
	returning error_mark_node.

        PR c++/28260
	* decl.c (duplicate_decls): Return error_mark_node
	on ambiguous declaration.

	PR c++/28258
	* g++/dg/other/error13.C: New test.

	PR c++/28260
	* g++.dg/template/friend44.C: New test.

From-SVN: r115561
This commit is contained in:
Lee Millward 2006-07-18 17:22:39 +00:00 committed by Lee Millward
parent 1e76e76b47
commit 492b73bda9
6 changed files with 41 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2006-07-18 Lee Millward <lee.millward@gmail.com>
PR c++/28258
* method.c (locate_copy): Check for non_reference
returning error_mark_node.
PR c++/28260
* decl.c (duplicate_decls): Return error_mark_node
on ambiguous declaration.
2006-07-18 Steve Ellcey <sje@cup.hp.com>
PR c++/27495

View File

@ -1371,6 +1371,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
{
error ("new declaration %q#D", newdecl);
error ("ambiguates old declaration %q+#D", olddecl);
return error_mark_node;
}
else
return NULL_TREE;

View File

@ -946,6 +946,10 @@ locate_copy (tree type, void *client_)
if (!parms)
continue;
src_type = non_reference (TREE_VALUE (parms));
if (src_type == error_mark_node)
return NULL_TREE;
if (!same_type_ignoring_top_level_qualifiers_p (src_type, type))
continue;
if (!sufficient_parms_p (TREE_CHAIN (parms)))

View File

@ -1,3 +1,11 @@
2006-07-18 Lee Millward <lee.millward@gmail.com>
PR c++/28258
* g++/dg/other/error13.C: New test.
PR c++/28260
* g++.dg/template/friend44.C: New test.
2006-07-18 Steve Ellcey <sje@cup.hp.com>
PR c++/27495

View File

@ -0,0 +1,10 @@
//PR c++/28258
struct A
{ // { dg-error "" }
A(void x); // { dg-error "invalid use|incomplete type|candidates" }
};
struct B : A {}; // { dg-error "no matching function for call" }
B b; // { dg-error "synthesized method" }

View File

@ -0,0 +1,8 @@
//PR c++/28260
template<int> struct A
{
friend int foo(); // { dg-error "new declaration" }
};
void foo() { A<0> a; } // { dg-error "ambiguates old declaration" }