PR c++/12333 - X::~X() with implicit this->.
authorJason Merrill <jason@redhat.com>
Wed, 18 Dec 2019 12:44:34 +0000 (07:44 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 18 Dec 2019 12:44:34 +0000 (07:44 -0500)
commit1ad431f95c200fe4d1eccab9cd5487087adc2bd8
treea43658ed7be8f865ba478101168b95d555962029
parent542803c9adea448854477e0a544455cffda7cd51
PR c++/12333 - X::~X() with implicit this->.

this->X::~X() is handled by finish_class_member_access_expr and its
lookup_destructor subroutine; let's use it in cp_parser_lookup_name for the
case where this-> is implicit.

I tried replacing the other destructor code here with just the call to
lookup_destructor, but that regressed handling of naming the destructor
outside a non-static member function.

* parser.c (cp_parser_lookup_name): Use lookup_destructor.
* typeck.c (lookup_destructor): No longer static.

From-SVN: r279522
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/lookup/dtor1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/dtor3.C