diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2018-09-24 17:42:45 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2018-09-24 17:42:45 +0000 |
commit | 06ff274feb26fd569fd167225d29479f5b974c45 (patch) | |
tree | b00ec4a1722b9036f2fcb7b7283cb8dd95bb7f3d | |
parent | 708c728d4fe7a5e169833729b8c57d08258ce15d (diff) | |
download | gcc-06ff274feb26fd569fd167225d29479f5b974c45.zip gcc-06ff274feb26fd569fd167225d29479f5b974c45.tar.gz gcc-06ff274feb26fd569fd167225d29479f5b974c45.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr85070.C | 13 |
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 }; |