Commit 3551c177 by Jason Merrill Committed by Jason Merrill

* typeck2.c (build_functional_cast): Handle default-initialization.

From-SVN: r21427
parent b3abfd6f
1998-07-27 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (build_functional_cast): Handle default-initialization.
* call.c (build_over_call): Pass 1 to popclass.
* parse.y (direct_notype_declarator): Add precedence declaration
to notype_unqualified_id case.
* Makefile.in (EXPECT): Adjust.
* tree.c (ovl_member): Fix for single function in OVL.
......
......@@ -215,7 +215,7 @@ parse.o : $(PARSE_C) $(CONFIG_H) $(CXX_TREE_H) $(srcdir)/../flags.h lex.h \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(BIG_SWITCHFLAG) \
`echo $(PARSE_C) | sed 's,^\./,,'`
CONFLICTS = expect 28 shift/reduce conflicts and 42 reduce/reduce conflicts.
CONFLICTS = expect 26 shift/reduce conflicts and 42 reduce/reduce conflicts.
$(PARSE_H) : $(PARSE_C)
$(PARSE_C) : $(srcdir)/parse.y
@echo $(CONFLICTS)
......
......@@ -1501,6 +1501,15 @@ build_functional_cast (exp, parms)
if (parms && TREE_CHAIN (parms) == NULL_TREE)
return build_c_cast (type, TREE_VALUE (parms));
/* We need to zero-initialize POD types. Let's do that for everything
that doesn't need a constructor. */
if (parms == NULL_TREE && !TYPE_NEEDS_CONSTRUCTING (type)
&& TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
{
exp = build (CONSTRUCTOR, type, NULL_TREE, NULL_TREE);
return get_target_expr (exp);
}
exp = build_method_call (NULL_TREE, ctor_identifier, parms,
TYPE_BINFO (type), LOOKUP_NORMAL);
......
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