aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@chromium.org>2014-09-09 06:50:26 -0700
committerSiva Chandra <sivachandra@chromium.org>2014-10-15 04:28:38 -0700
commitebb8ece2ef50ba3f86e8b4ab7a22a4c7734d114b (patch)
tree493f3eaf1d73d2790cef9cc8a8d4ef000c8180a7
parent2d1c107c1b8835f4e85c35320d8595a4a6fcaebe (diff)
downloadgdb-ebb8ece2ef50ba3f86e8b4ab7a22a4c7734d114b.zip
gdb-ebb8ece2ef50ba3f86e8b4ab7a22a4c7734d114b.tar.gz
gdb-ebb8ece2ef50ba3f86e8b4ab7a22a4c7734d114b.tar.bz2
Fix gnuv3_pass_by_reference to treat dynamic classes as non-trivial.
gdb/ChangeLog: * gnu-v3-abi.c (gnuv3_pass_by_reference): Treat dynamic classes as non-trivial.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gnu-v3-abi.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c33f6cc..c4f0437 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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
PR c++/15154
* gnu-v3-abi.c (gnuv3_pass_by_reference): Lookup copy constructors
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 558ec06..a6c6f9f 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -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++)