From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114511 invoked by alias); 19 Feb 2016 18:53:39 -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 113143 invoked by uid 89); 19 Feb 2016 18:53:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2140 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 19 Feb 2016 18:53:38 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 22807627C5; Fri, 19 Feb 2016 18:53:37 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JIradL000788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 19 Feb 2016 13:53:36 -0500 From: Keith Seitz Subject: Re: [PATCH v2 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type To: Artemiy Volkov References: <1450661481-31178-1-git-send-email-artemiyv@acm.org> <1453229609-20159-1-git-send-email-artemiyv@acm.org> <1453229609-20159-5-git-send-email-artemiyv@acm.org> Cc: gdb-patches@sourceware.org Message-ID: <56C764B0.4080006@redhat.com> Date: Fri, 19 Feb 2016 18:53:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1453229609-20159-5-git-send-email-artemiyv@acm.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00614.txt.bz2 Another patch of nothing but coding standard "nits." On 01/19/2016 10:53 AM, Artemiy Volkov wrote: > 2016-01-19 Artemiy Volkov > > * gdb/c-exp.y: Handle the '&&' token in the typename. > * gdb/parse.c (insert_type): Change assert statement. > (follow_types): Handle rvalue reference types. > * gdb/parser-defs.h (enum type_pieces): Add tp_rvalue_reference > constant. Nit: That last one should be * parser-defs.h (enum type_pieces) : New constant. > diff --git a/gdb/parse.c b/gdb/parse.c > index 06f7bcd..75627c5 100644 > --- a/gdb/parse.c > +++ b/gdb/parse.c > @@ -1695,21 +1695,26 @@ follow_types (struct type *follow_type) > make_addr_space = 0; > break; > case tp_reference: > - follow_type = lookup_lvalue_reference_type (follow_type); > - if (make_const) > - follow_type = make_cv_type (make_const, > - TYPE_VOLATILE (follow_type), > - follow_type, 0); > - if (make_volatile) > - follow_type = make_cv_type (TYPE_CONST (follow_type), > - make_volatile, > - follow_type, 0); > - if (make_addr_space) > - follow_type = make_type_with_address_space (follow_type, > - make_addr_space); > + follow_type = lookup_lvalue_reference_type (follow_type); > + goto process_reference; > + case tp_rvalue_reference: > + follow_type = lookup_rvalue_reference_type (follow_type); > + process_reference: > + if (make_const) > + follow_type = make_cv_type (make_const, > + TYPE_VOLATILE (follow_type), > + follow_type, 0); > + if (make_volatile) > + follow_type = make_cv_type (TYPE_CONST (follow_type), > + make_volatile, > + follow_type, 0); > + if (make_addr_space) > + follow_type = make_type_with_address_space (follow_type, > + make_addr_space); > make_const = make_volatile = 0; > make_addr_space = 0; > break; > + Just a comment -- nothing for you to do. This process_reference: really is about dealing with qualifiers, and I see that this is cut-n-pasted into several different cases. Yuck. > case tp_array: > array_size = pop_type_int (); > /* FIXME-type-allocation: need a way to free this type when we are Keith