https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12333
--- Comment #19 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Wed Dec 18 12:44:34 2019 New Revision: 279522 URL: https://gcc.gnu.org/viewcvs?rev=279522&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/lookup/dtor1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/parser.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/g++.dg/parse/dtor3.C