aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr85070.C13
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 079d1cb..6d4e93b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/85070
+ * method.c (lazily_declare_fn): During error-recovery add_method
+ may return false.
+
2018-09-21 Marek Polacek <polacek@redhat.com>
PR c++/87372 - __func__ constexpr evaluation.
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index d75dacb..5379b4d 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -2421,7 +2421,7 @@ lazily_declare_fn (special_function_kind sfk, tree type)
/* Add it to the class */
bool added = add_method (type, fn, false);
- gcc_assert (added);
+ gcc_assert (added || errorcount);
/* Add it to TYPE_FIELDS. */
if (sfk == sfk_destructor
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b98b6eb..2243179 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/85070
+ * g++.dg/cpp0x/pr85070.C: New.
+
2018-09-24 H.J. Lu <hongjiu.lu@intel.com>
PR target/82699
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr85070.C b/gcc/testsuite/g++.dg/cpp0x/pr85070.C
new file mode 100644
index 0000000..c1c5b23
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr85070.C
@@ -0,0 +1,13 @@
+// { dg-do compile { target c++11 } }
+
+struct A;
+
+struct B
+{
+ constexpr A & operator= (const A &); // { dg-warning "used" "" { target c++14_only } }
+};
+
+struct A : B // { dg-error "cannot be overloaded" "" { target c++14_only } }
+{
+ using B::operator=;
+} a { a = a };