A program that calls for default-initialization or
value-initialization of an entity of reference type is ill-formed. */
- /* The AGGR_INIT_EXPR tweaking below breaks in templates. */
- gcc_assert (!processing_template_decl
- || (SCALAR_TYPE_P (type) || TREE_CODE (type) == ARRAY_TYPE));
-
if (CLASS_TYPE_P (type) && type_build_ctor_call (type))
{
tree ctor
NULL, type, LOOKUP_NORMAL, complain);
if (ctor == error_mark_node || TREE_CONSTANT (ctor))
return ctor;
+ if (processing_template_decl)
+ /* The AGGR_INIT_EXPR tweaking below breaks in templates. */
+ return build_min (CAST_EXPR, type, NULL_TREE);
tree fn = NULL_TREE;
if (TREE_CODE (ctor) == CALL_EXPR)
fn = get_callee_fndecl (ctor);