Commit c19a8067 by Jason Merrill Committed by Mike Stump

72nd Cygnus<->FSF merge

From-SVN: r9737
parent 01e7bd9a
Wed May 17 01:43:58 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* class.c (finish_struct): Don't complain about a class with no
user-defined constructors but with a member that has no default
constructor, as this is OK for aggregates.
* expr.c (cplus_expand_expr, NEW_EXPR): If this is an explicit
constructor call, mark slot addressable.
Tue May 16 18:37:51 1995 Douglas Rupp (drupp@cs.washington.edu) Tue May 16 18:37:51 1995 Douglas Rupp (drupp@cs.washington.edu)
* g++.c: Changed WINNT to _WIN32. * g++.c: Changed WINNT to _WIN32.
......
...@@ -3287,6 +3287,8 @@ finish_struct (t, list_of_fieldlists, warn_anon) ...@@ -3287,6 +3287,8 @@ finish_struct (t, list_of_fieldlists, warn_anon)
&& ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
{ {
cant_have_default_ctor = 1; cant_have_default_ctor = 1;
#if 0
/* This is wrong for aggregates. */
if (! TYPE_HAS_CONSTRUCTOR (t)) if (! TYPE_HAS_CONSTRUCTOR (t))
{ {
if (DECL_NAME (x)) if (DECL_NAME (x))
...@@ -3296,6 +3298,7 @@ finish_struct (t, list_of_fieldlists, warn_anon) ...@@ -3296,6 +3298,7 @@ finish_struct (t, list_of_fieldlists, warn_anon)
cp_pedwarn_at ("in class without a constructor", cp_pedwarn_at ("in class without a constructor",
x); x);
} }
#endif
} }
} }
if (DECL_INITIAL (x) != NULL_TREE) if (DECL_INITIAL (x) != NULL_TREE)
......
...@@ -107,6 +107,7 @@ cplus_expand_expr (exp, target, tmode, modifier) ...@@ -107,6 +107,7 @@ cplus_expand_expr (exp, target, tmode, modifier)
type = TYPE_POINTER_TO (type); type = TYPE_POINTER_TO (type);
/* Don't clobber a value that might be part of a default /* Don't clobber a value that might be part of a default
parameter value. */ parameter value. */
mark_addressable (slot);
if (TREE_PERMANENT (args)) if (TREE_PERMANENT (args))
args = tree_cons (0, build1 (ADDR_EXPR, type, slot), args = tree_cons (0, build1 (ADDR_EXPR, type, slot),
TREE_CHAIN (args)); TREE_CHAIN (args));
......
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