When operator new is used on a class with no constructor it generates an AGGR_INIT_EXPR, not a CALL_EXPR... with testcase. NPODB, static-checking only.

This commit is contained in:
Benjamin Smedberg
2008-12-03 11:49:54 -05:00
parent 5be7b713bf
commit e93d279a87
3 changed files with 19 additions and 3 deletions

View File

@@ -167,11 +167,12 @@ function process_cp_pre_genericize(fndecl)
break;
case CALL_EXPR:
case AGGR_INIT_EXPR:
assign = stack[i + 1];
break;
default:
error("Unrecognized assignment from operator new: " + TREE_CODE(assign), getLocation());
error("Unrecognized assignment from operator new: %s. Tree code stack: %s".format(TREE_CODE(assign), [TREE_CODE(s) for each (s in stack)].join(",")), getLocation());
return;
}