diff options
author | Patrick Palka <ppalka@gcc.gnu.org> | 2016-03-18 01:26:50 +0000 |
---|---|---|
committer | Patrick Palka <ppalka@gcc.gnu.org> | 2016-03-18 01:26:50 +0000 |
commit | 91914f0adb0b128c74773872a478c3d4da143ab8 (patch) | |
tree | 619c8c890d441716e4c6672640e51e46fdd11dc0 /gcc | |
parent | 753a8910a4c9021ff81e9892ac58c50c0fdb6d69 (diff) | |
download | gcc-91914f0adb0b128c74773872a478c3d4da143ab8.zip gcc-91914f0adb0b128c74773872a478c3d4da143ab8.tar.gz gcc-91914f0adb0b128c74773872a478c3d4da143ab8.tar.bz2 |
Fix PR c++/70205 (ICE on valid call to qualified static member function)
gcc/cp/ChangeLog:
PR c++/70205
* search.c (adjust_result_of_qualified_name_lookup): Don't
update the BASELINK_BINFO of DECL if the second call
to lookup_base fails.
gcc/testsuite/ChangeLog:
PR c++/70205
* g++.dg/lookup/pr70205.C: New test.
From-SVN: r234317
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/search.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/pr70205.C | 11 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 764122a..7e3ceeb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,12 @@ 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org> + PR c++/70205 + * search.c (adjust_result_of_qualified_name_lookup): Don't + update the BASELINK_BINFO of DECL if the second call + to lookup_base fails. + +2016-03-18 Patrick Palka <ppalka@gcc.gnu.org> + PR c++/70218 * parser.c (cp_parser_lambda_expression): Move call to pop_deferring_access_checks ahead of the call to diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 7924611..503e34b 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1751,9 +1751,11 @@ adjust_result_of_qualified_name_lookup (tree decl, if (base && base != error_mark_node) { BASELINK_ACCESS_BINFO (decl) = base; - BASELINK_BINFO (decl) + tree decl_binfo = lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)), ba_unique, NULL, tf_none); + if (decl_binfo && decl_binfo != error_mark_node) + BASELINK_BINFO (decl) = decl_binfo; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f792ee..b56c9bf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org> + PR c++/70205 + * g++.dg/lookup/pr70205.C: New test. + +2016-03-18 Patrick Palka <ppalka@gcc.gnu.org> + PR c++/70218 * g++.dg/cpp0x/lambda/lambda-70218.C: New test. diff --git a/gcc/testsuite/g++.dg/lookup/pr70205.C b/gcc/testsuite/g++.dg/lookup/pr70205.C new file mode 100644 index 0000000..3bda7fb --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pr70205.C @@ -0,0 +1,11 @@ +// PR c++/70205 + +struct A +{ +protected: + static void f (); +}; +struct B : A { }; +struct C : A { }; +struct D : C, B { void a () { D::f (); } }; +struct E : D { void b () { D::f (); } }; |