Fix gnuv3_pass_by_reference to treat dynamic classes as non-trivial.
authorSiva Chandra <sivachandra@chromium.org>
Tue, 9 Sep 2014 13:50:26 +0000 (06:50 -0700)
committerSiva Chandra <sivachandra@chromium.org>
Wed, 15 Oct 2014 11:28:38 +0000 (04:28 -0700)
gdb/ChangeLog:

* gnu-v3-abi.c (gnuv3_pass_by_reference): Treat dynamic classes
as non-trivial.

gdb/ChangeLog
gdb/gnu-v3-abi.c

index c33f6ccfa992de68c3748a15913ee22293b16fbd..c4f0437606c28a13c1b8388e5a2ea0021c4349bf 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-15  Siva Chandra Reddy  <sivachandra@google.com>
+
+       * gnu-v3-abi.c (gnuv3_pass_by_reference): Treat dynamic classes
+       as non-trivial.
+
 2014-10-15  Siva Chandra Reddy  <sivachandra@google.com>
 
        PR c++/13403
index 558ec06ccfadffb6e3b775d143feb5e5fa902a14..a6c6f9fd9c8308b83d88964fadc3ca31b7e84854 100644 (file)
@@ -1281,6 +1281,11 @@ gnuv3_pass_by_reference (struct type *type)
       && TYPE_CODE (type) != TYPE_CODE_UNION)
     return 0;
 
+  /* A dynamic class has a non-trivial copy constructor.
+     See c++98 section 12.8 Copying class objects [class.copy].  */
+  if (gnuv3_dynamic_class (type))
+    return 1;
+
   for (fieldnum = 0; fieldnum < TYPE_NFN_FIELDS (type); fieldnum++)
     for (fieldelem = 0; fieldelem < TYPE_FN_FIELDLIST_LENGTH (type, fieldnum);
         fieldelem++)