From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15777 invoked by alias); 23 Apr 2003 23:49:10 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15770 invoked from network); 23 Apr 2003 23:49:10 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 23 Apr 2003 23:49:10 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h3NNn9307141; Wed, 23 Apr 2003 16:49:09 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] handling of 'operator' in cp_find_first_component References: <20030422032152.GA5033@nevyn.them.org> From: David Carlton Date: Thu, 24 Apr 2003 01:25:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-04/txt/msg00459.txt.bz2 On 23 Apr 2003 16:02:06 -0700, David Carlton said: > On Mon, 21 Apr 2003 23:21:52 -0400, Daniel Jacobowitz said: >> That said, I still think your patch is OK; on the condition that it >> handles the test case the comment you're removing refers to. Something >> like: >> int foo >> or whatever it was in the right syntax. Does it, and can you add that >> to the maint.exp tests? > It should handle them, but you're right, I should include such > examples in the maint.exp tests. I'll go off and generate some > examples first before checking it in. I've checked it in with more examples, as you requested. I can get the demangler to produce this: jackfruit$ c++filt _Z3fooIXadL_Zls1CS0_EEEiv int foo<&(operator<<(C, C))>() Just to be on the safe side, I added variants of that without the extra parens and even without the &, but with a comment that I'd only seen the first one in the wild. I'm including the new maint.exp patch below; I didn't change the cp-support.c patch. David Carlton carlton@math.stanford.edu 2003-04-23 David Carlton * gdb.c++/maint.exp (test_first_component): Add tests for 'operator' in more locations. Index: maint.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/maint.exp,v retrieving revision 1.1 diff -u -p -r1.1 maint.exp --- maint.exp 15 Apr 2003 23:07:11 -0000 1.1 +++ maint.exp 23 Apr 2003 23:43:31 -0000 @@ -63,6 +63,18 @@ proc test_first_component {} { test_single_component "foo(std::basic_streambuf >)" test_single_component "operator>(X::Y)" + # Operator names can show up in weird places. + + test_single_component "int operator<< ()" + test_single_component "T" + + # NOTE: carlton/2003-04-23: I've only seen the first of these + # produced by the demangler, but I'm including two more just to be + # on the safe side. + test_single_component "int foo<&(operator<<(C, C))>()" + test_single_component "int foo<&operator<<(C, C)>()" + test_single_component "int foo()" + gdb_test "maint cp first_component foo::bar" "foo" gdb_test "maint cp first_component foo::bar::baz" "foo" gdb_test "maint cp first_component C::bar" "C"