aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 9383e92..a2fcc1f 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -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);