72nd Cygnus<->FSF merge
authorJason Merrill <jason@phydeaux.cygnus.com>
Wed, 17 May 1995 23:34:39 +0000 (23:34 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Wed, 17 May 1995 23:34:39 +0000 (23:34 +0000)
From-SVN: r9737

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/expr.c

index b40acc3d36e4aae28d0d48e89bf634f0015026b5..e8bc6e22282badf944c71f536773674f9f8965c2 100644 (file)
@@ -1,3 +1,12 @@
+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)
 
        * g++.c: Changed WINNT to _WIN32.
index 7463058e760abf365f654810b684971df01aafa9..a1a1fa8c434edd677a353c656808e967d3530e3a 100644 (file)
@@ -3287,6 +3287,8 @@ finish_struct (t, list_of_fieldlists, warn_anon)
                      && ! TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
                    {
                      cant_have_default_ctor = 1;
+#if 0
+                     /* This is wrong for aggregates.  */
                      if (! TYPE_HAS_CONSTRUCTOR (t))
                        {
                          if (DECL_NAME (x))
@@ -3296,6 +3298,7 @@ finish_struct (t, list_of_fieldlists, warn_anon)
                          cp_pedwarn_at ("in class without a constructor",
                                         x);
                        }
+#endif
                    }
                }
              if (DECL_INITIAL (x) != NULL_TREE)
index c722dcbe6e0682fb393fca8f3f182a975372c575..27da793b1a7ed4060e0729742cb6dc8eb69ac140 100644 (file)
@@ -107,6 +107,7 @@ cplus_expand_expr (exp, target, tmode, modifier)
            type = TYPE_POINTER_TO (type);
            /* Don't clobber a value that might be part of a default
               parameter value.  */
+           mark_addressable (slot);
            if (TREE_PERMANENT (args))
              args = tree_cons (0, build1 (ADDR_EXPR, type, slot),
                                TREE_CHAIN (args));