re PR c++/85070 (ICE on C++ code: in lazily_declare_fn, at cp/method.c:2409)

/cp
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.

/testsuite
2018-09-24  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/85070
	* g++.dg/cpp0x/pr85070.C: New.

From-SVN: r264541
This commit is contained in:
Paolo Carlini 2018-09-24 17:42:45 +00:00 committed by Paolo Carlini
parent 708c728d4f
commit 06ff274feb
4 changed files with 25 additions and 1 deletions

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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 };