Commit a85cb0d7 by Volker Reichelt Committed by Volker Reichelt

re PR c++/22508 (ICE after invalid operator new)

	PR c++/22508
	* init.c (build_new_1): Check for empty candidate list.

	* g++.dg/init/new13.C: New test.

From-SVN: r102863
parent 7a4eca66
2005-08-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22508
* init.c (build_new_1): Check for empty candidate list.
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23191
......
......@@ -1918,6 +1918,11 @@ build_new_1 (tree exp)
args = tree_cons (NULL_TREE, size, placement);
/* Do name-lookup to find the appropriate operator. */
fns = lookup_fnfields (elt_type, fnname, /*protect=*/2);
if (fns == NULL_TREE)
{
error ("no suitable %qD found in class %qT", fnname, elt_type);
return error_mark_node;
}
if (TREE_CODE (fns) == TREE_LIST)
{
error ("request for member %qD is ambiguous", fnname);
......
2005-08-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22508
* g++.dg/init/new13.C: New test.
2005-08-08 Nathan Sidwell <nathan@codesourcery.com>
PR c++/21166
......
// PR c++/22508
// ICE on invalid operator new
// Origin: Flash Sheridan <flash@pobox.com>
// { dg-do compile }
struct A
{
void* operator new(__SIZE_TYPE__) throw(X); // { dg-error "" }
};
A* p = new A; // { dg-error "no suitable" }
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