From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18403 invoked by alias); 2 Feb 2018 03:35:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18368 invoked by uid 89); 2 Feb 2018 03:35:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*r:8.14.7 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Feb 2018 03:35:49 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w123Zfto027622 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Feb 2018 22:35:46 -0500 Received: from [10.0.0.11] (192-222-251-162.qc.cable.ebox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A5B9A1E48F; Thu, 1 Feb 2018 22:35:41 -0500 (EST) Subject: Re: [PATCH v4] Do not classify C struct members as a filename To: Leszek Swirski , gdb-patches@sourceware.org Cc: Tom Tromey References: <87zi52gc8u.fsf@tromey.com> <20180125162047.126498-1-leszeks@google.com> From: Simon Marchi Message-ID: <8fd13493-de62-5fea-ebca-13668aa1580b@polymtl.ca> Date: Fri, 02 Feb 2018 03:35:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180125162047.126498-1-leszeks@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 2 Feb 2018 03:35:41 +0000 X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00029.txt.bz2 On 2018-01-25 11:20 AM, Leszek Swirski wrote: > There is existing logic in C/C++ expression parsing to avoid classifying > names as a filename when they are a field on the this object. This > change extends this logic to also avoid classifying names after a > struct-op (-> or .) as a filename, which otherwise causes a syntax > error. > > Thus, it is now possible in the file > > #include > struct D { > void map(); > } > D d; > > to call > > (gdb) print d.map() > > where previously this would have been a syntax error. > > Tested on gdb.cp/*.exp > > gdb/ChangeLog: > > * c-exp.y (lex_one_token, classify_name, yylex): Don't classify > names after a structop as a filename > > gdb/testsuite/ChangeLog: > > * gdb.cp/filename.cc, gdb.cp/filename.exp: Test that member > functions with the same name as an include file are parsed > correctly. > --- > > Fix completion token to only appear on completion. > > gdb/ChangeLog | 5 +++++ > gdb/c-exp.y | 45 +++++++++++++++++++++------------------ > gdb/testsuite/ChangeLog | 6 ++++++ > gdb/testsuite/gdb.cp/filename.cc | 22 ++++++++++++++++++- > gdb/testsuite/gdb.cp/filename.exp | 20 +++++++++++++++-- > 5 files changed, 74 insertions(+), 24 deletions(-) Thanks for the update, I have pushed it. Simon