Commit 492b73bd by Lee Millward Committed by Lee Millward

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
parent 1e76e76b
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
......
......@@ -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;
......
......@@ -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)))
......
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
//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" }
//PR c++/28260
template<int> struct A
{
friend int foo(); // { dg-error "new declaration" }
};
void foo() { A<0> a; } // { dg-error "ambiguates old declaration" }
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