From: Paolo Carlini Date: Thu, 22 Sep 2016 15:26:23 +0000 (+0000) Subject: re PR c++/71979 (ICE with on C++ code with incorrect type in overloaded base class... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a608d15bedbdfd925f099d11e4a826f433bb3a41;p=gcc.git re PR c++/71979 (ICE with on C++ code with incorrect type in overloaded base class '=' operator: in build_base_path, at cp/class.c:304) /cp 2016-09-22 Paolo Carlini PR c++/71979 * class.c (build_base_path): Allow for lookup_base returning NULL_TREE. /testsuite 2016-09-22 Paolo Carlini PR c++/71979 * g++.dg/cpp0x/pr71979.C: New. From-SVN: r240373 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 61d41e739ad..3a4d1f45f8c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-09-22 Paolo Carlini + + PR c++/71979 + * class.c (build_base_path): Allow for lookup_base returning + NULL_TREE. + 2016-09-21 Jason Merrill Core 903 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 7362c732646..dab163020f4 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -296,12 +296,13 @@ build_base_path (enum tree_code code, /* This can happen when adjust_result_of_qualified_name_lookup can't find a unique base binfo in a call to a member function. We couldn't give the diagnostic then since we might have been calling - a static member function, so we do it now. */ + a static member function, so we do it now. In other cases, eg. + during error recovery (c++/71979), we may not have a base at all. */ if (complain & tf_error) { tree base = lookup_base (probe, BINFO_TYPE (d_binfo), ba_unique, NULL, complain); - gcc_assert (base == error_mark_node); + gcc_assert (base == error_mark_node || !base); } return error_mark_node; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8adecc03c63..6daa92163b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-09-22 Paolo Carlini + + PR c++/71979 + * g++.dg/cpp0x/pr71979.C: New. + 2016-09-22 Bernd Edlinger * g++.dg/pr77550.C: Use __SIZE_TYPE__. diff --git a/gcc/testsuite/g++.dg/cpp0x/pr71979.C b/gcc/testsuite/g++.dg/cpp0x/pr71979.C new file mode 100644 index 00000000000..e67eed111ac --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr71979.C @@ -0,0 +1,15 @@ +// PR c++/71979 +// { dg-do compile { target c++11 } } + +struct A +{ + A & operator= (A &); +}; + +struct B : A {}; // { dg-error "cannot bind" } + +void foo () +{ + B b; + b = B (); // { dg-error "use of deleted" } +}