From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121292 invoked by alias); 16 Mar 2016 22:48:35 -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 121185 invoked by uid 89); 16 Mar 2016 22:48:34 -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=examine, 1276, utility, stray 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; Wed, 16 Mar 2016 22:48:24 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A265064D13; Wed, 16 Mar 2016 22:48:23 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2GMmMSa024338 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Mar 2016 18:48:23 -0400 From: Keith Seitz Subject: Re: [PATCH v3 11/11] [PR gdb/14441] gdb: testsuite: add rvalue reference tests To: Artemiy Volkov , gdb-patches@sourceware.org References: <1453229609-20159-1-git-send-email-artemiyv@acm.org> <1457147955-21871-1-git-send-email-artemiyv@acm.org> <1457147955-21871-12-git-send-email-artemiyv@acm.org> Message-ID: <56E9E2B6.8040909@redhat.com> Date: Wed, 16 Mar 2016 22:48: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: <1457147955-21871-12-git-send-email-artemiyv@acm.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00281.txt.bz2 On 03/04/2016 07:19 PM, Artemiy Volkov wrote: > diff --git a/gdb/testsuite/gdb.cp/overload.cc b/gdb/testsuite/gdb.cp/overload.cc > index 5c782a4..05cbded 100644 > --- a/gdb/testsuite/gdb.cp/overload.cc > +++ b/gdb/testsuite/gdb.cp/overload.cc > @@ -1,10 +1,12 @@ > #include > +#include > > class foo { > public: > foo (int); > foo (int, const char *); > foo (foo&); > + foo (foo&&); > ~foo (); > void foofunc (int); > void foofunc (int, signed char *); > @@ -27,6 +29,14 @@ int overload1arg (double); > int overload1arg (int*); > int overload1arg (void*); > > +typedef foo &foo_lval_ref; > +typedef foo &&foo_rval_ref; > + > +int overload1arg (foo &); > +int overload1arg (foo &&); > +int overload1arg (foo_lval_ref); > +int overload1arg (foo_rval_ref); > + With GCC6, I am getting the build error "cannot overload `int overload1arg(foo &)' with `int overload1arg(foo_lval_ref)'". Likewise with foo &&/foo_rval_ref. > int overloadfnarg (void); > int overloadfnarg (int); > int overloadfnarg (int, int (*) (int)); > diff --git a/gdb/testsuite/gdb.cp/ref-types.exp b/gdb/testsuite/gdb.cp/ref-types.exp > index 3b557f9..fbaafc1 100644 > --- a/gdb/testsuite/gdb.cp/ref-types.exp > +++ b/gdb/testsuite/gdb.cp/ref-types.exp > @@ -127,6 +128,35 @@ gdb_test "print ras\[1\]" ".\[0-9\]* = 1" "print value of ras\[1\]" > gdb_test "print ras\[2\]" ".\[0-9\]* = 2" "print value of ras\[2\]" > gdb_test "print ras\[3\]" ".\[0-9\]* = 3" "print value of ras\[3\]" > > +# rvalue reference tests > + > +gdb_test_multiple "print rrt" "print value of rrt" { > + -re ".\[0-9\]* = \\(short( int)? &&\\) @$hex: -1.*$gdb_prompt $" { > + pass "print value of rrt" > + } > + eof { fail "print rrt ($gdb dumped core) (fixme)" ; gdb_start_again ; } > +} > + > +gdb_test "ptype rrt" "type = short( int)? &&.*$gdb_prompt $" "ptype rrt" > + This test doesn't pass -- the expected result is incorrect. Remove ".*$gdb_prompt $". gdb_test will automatically append this. > +gdb_test "print *rrpt" ".$decimal = -1" "print value of *rrpt" > + > +# gdb had a bug about dereferencing a pointer type > +# that would lead to wrong results > +# if we try to examine memory at pointer value. > + > +gdb_test "x /hd rrpt" "$hex:\[ \t\]*-1" "examine value at rrpt" > + > +gdb_test "ptype rrpt" "type = short( int)? \\*&&.*$gdb_prompt $" "ptype rrpt" > + Same here. > +gdb_test "print rrat\[0\]" ".$decimal = 0" "print value of rrat\[0\]" > + > +gdb_test "ptype rrat" "type = short( int)? \\\(&&\\\)\\\[4\\\].*$gdb_prompt $" "ptype rrat" { > + and here. There's also a stray '{' at the end here. > +gdb_test "print rrat\[1\]" ".$decimal = 1" "print value of rrat\[1\]" > +gdb_test "print rrat\[2\]" ".$decimal = 2" "print value of rrat\[2\]" > +gdb_test "print rrat\[3\]" ".$decimal = 3" "print value of rrat\[3\]" > + > > if ![runto 'f'] then { > perror "couldn't run to f" Thank you! Keith