aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2018-06-12 20:20:11 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2018-06-12 20:20:11 +0000
commit4db9ca8624e902b668ef394cf81e68e4ed5faa89 (patch)
tree4ac1af0c3684d81cd27dc2dee67e25f84978fc90 /gcc/cp
parent84a9d3b6c1f1de2aa6b5bef700f51b2e7c0bc600 (diff)
downloadgcc-4db9ca8624e902b668ef394cf81e68e4ed5faa89.zip
gcc-4db9ca8624e902b668ef394cf81e68e4ed5faa89.tar.gz
gcc-4db9ca8624e902b668ef394cf81e68e4ed5faa89.tar.bz2
Core issue 1331 - const mismatch with defaulted copy constructor
Core issue 1331 - const mismatch with defaulted copy constructor * class.c (check_bases_and_members): When checking a defaulted function, mark it as deleted rather than giving an error. * g++.dg/cpp0x/defaulted15.C (struct F): Remove dg-error. * g++.dg/cpp0x/defaulted52.C: New test. * g++.dg/cpp0x/defaulted53.C: New test. * g++.dg/cpp0x/defaulted54.C: New test. * g++.dg/cpp0x/defaulted55.C: New test. * g++.dg/cpp0x/defaulted56.C: New test. * g++.dg/cpp0x/defaulted57.C: New test. * g++.dg/cpp0x/defaulted58.C: New test. * g++.dg/cpp0x/defaulted59.C: New test. * g++.dg/cpp0x/defaulted60.C: New test. From-SVN: r261526
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/class.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 585f111..726fd7f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-12 Marek Polacek <polacek@redhat.com>
+
+ Core issue 1331 - const mismatch with defaulted copy constructor
+ * class.c (check_bases_and_members): When checking a defaulted
+ function, mark it as deleted rather than giving an error.
+
2018-06-11 Jason Merrill <jason@redhat.com>
PR c++/85792 -Wctor-dtor-privacy and inherited constructor.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index fbf3903..b6e78c6 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -5660,9 +5660,9 @@ check_bases_and_members (tree t)
if (fn_const_p && !imp_const_p)
/* If the function is defaulted outside the class, we just
- give the synthesis error. */
- error ("%q+D declared to take const reference, but implicit "
- "declaration would take non-const", fn);
+ give the synthesis error. Core Issue #1331 says this is
+ no longer ill-formed, it is defined as deleted instead. */
+ DECL_DELETED_FN (fn) = true;
}
defaulted_late_check (fn);
}