From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id j0x0HJfosmnYLCYAWB0awg (envelope-from ) for ; Thu, 12 Mar 2026 12:23:51 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=XCizlNop; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sfylzmzs; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PQb7wSzR; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=mlV6m/i9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 60A121E089; Thu, 12 Mar 2026 12:23:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C1AC21E089 for ; Thu, 12 Mar 2026 12:23:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DA6074BBCDE1 for ; Thu, 12 Mar 2026 16:23:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA6074BBCDE1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=XCizlNop; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sfylzmzs; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PQb7wSzR; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=mlV6m/i9 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 984314BA2E1D for ; Thu, 12 Mar 2026 16:23:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 984314BA2E1D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 984314BA2E1D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773332595; cv=none; b=LH2UnuSvbKBBCa+iinEiIMtQWR12S03P4ZnijIuIqHyPli+Su8CTm4bcc2jEcGRv8A9v9Wl1Cjcg6q0eDAc2EAEWzPWP9eHlikYy+3sJnlEurJyCNKiidNQVRRD2NbLS24+tLiJyGz9Bu/X7HrUDLwIgbusuIM6Zxydpf6ZzuY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773332595; c=relaxed/simple; bh=Zy4I4/x3PRGFhsKkRHWbf4UAJcU8eqS0lS1PDP5f0HM=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=auFYoA+VyfrG7Xhi2OMNAx0lqM6KKrBNe8MWt6sn7+LJQYjuzrA4kIoJn/LFSEXDBkb6kGuPfC6t4T1wpzaQPQtVo34ai5zWistq65+DvwXg/VPjPjZ8WgbiZkxcIa9LAyahCExMpvp03DwopHU0p8Sdk8KF5gpxn5Mq3Zb7fSw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 984314BA2E1D Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 839DA5C038; Thu, 12 Mar 2026 16:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773332594; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LM1jQcExaLKtpMlDP/jfdQPZ/XWVQyrD7LvAVzK5pxk=; b=XCizlNop0j588LsFuzMHv5QV8LDcgK2UjzlWvLgCkrT6n59+PhN2VwRBtgzp3SUmwyxD86 6TXCZXPsRqj/WPOp9QrAVgA7jTERErxewE0wo6Zde1WSRwIAwwyysKXfosfScQATeXnTZQ yc2IdNOXOBsl6al3RVCnsN3wlp8pFOQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773332594; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LM1jQcExaLKtpMlDP/jfdQPZ/XWVQyrD7LvAVzK5pxk=; b=sfylzmzs52vVjZlmsqmrA2HejWSIFDCE4sSUfSQ37YXLNtkqOHqQCOSuHZgYB/OIJ+JNGk SrMNEUUoi34WnsCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1773332593; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LM1jQcExaLKtpMlDP/jfdQPZ/XWVQyrD7LvAVzK5pxk=; b=PQb7wSzR+sC8xGrgirPYL1c/vgSKQAAJCq6sTK947VOvbhO1H7zBV4nCatb/3gDtGWj4FC ov/gm+Fo25LDiDfaObJNfbNKK5UrBMUF5tz5zsPlE1gZfXLd2Q0dW+1b/kHylbvvDaBXPc FHSIB8TxaiSJjKGpT7OivN9U3WQcfNc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1773332593; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LM1jQcExaLKtpMlDP/jfdQPZ/XWVQyrD7LvAVzK5pxk=; b=mlV6m/i9w3ZNXAMMPBvWI5NfCBE8S//qiZVfcR4AbB1udnihG3WVzkYKb900djDm6XWIUn 7s778pEMqSjOanCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 63B3D40069; Thu, 12 Mar 2026 16:23:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id snfwFnHosmkvbgAAD6G6ig (envelope-from ); Thu, 12 Mar 2026 16:23:13 +0000 Message-ID: Date: Thu, 12 Mar 2026 17:23:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] infcall: Add support for integer literals as reference function parameters To: Keith Seitz , gdb-patches@sourceware.org References: <92575c2eb6805095b41ebbe62ba99b81e4e5dd63.1760629738.git.keiths@redhat.com> Content-Language: en-US From: Tom de Vries In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 3/12/26 3:14 PM, Keith Seitz wrote: > This is v5 of my attempt to add simple integer literal support for refernece Hi Keith, refernece -> reference > parameters in inferior function calls. The goal here is to take a step toward > a better user experience when working with standard containers such as std::map. > > While hacking at the parser to add new related functionality, I've come to realize > that heap allocation is much safer than using the heap. We just really cannot know Did you mean: "using the heap"? FWIW, I've applied the patch and ran the test-case, and confirmed that it passes. Also, I applied the test-case from this patch ( https://sourceware.org/pipermail/gdb-patches/2024-November/213340.html ) and confirmed that it also passes with this patch. I'm not sure if that means that you can claim the corresponding PR as well, or if it means that the test-case I wrote was not representive of the PR. > how a user (or their program) handles any of these values. > > Keith > > Changes in v5 > - Return to heap allocation > > Changes in v4 > - Allocate to stack instead of heap > - Use value::force_lval to simply copying to inferior memory > - Add some addition tests > > Changes in v3 > - Move logic to value_arg_coerce > - Add some attempt to limit copying to trivially copyable types > > ----- > > This patch attempts to mitigate the shortcomings of passing literals > to inferior function calls requiring references. The specific use case here > is std::map's operator[]: > > std::map int_map; > int_map[1] = 10; > (gdb) print int_map[1] > Attempt to take address of value not located in memory. > > This is occurring because while value_coerce_to_target understands > that some values need to be allocated and copied to the inferior's > memory, it only considers the actual parsed type of the argument value, > ignoring the actual type of the function parameter. That is, > Changes in v5 > - After reconsideration, return to heap allocation > > Changes in v4 > - Allocate to stack instead of heap > - Use value::force_lval to simply copying to inferior memory > - Add some addition tests > > Changes in v3 > - Move logic to value_arg_coerce > - Add some attempt to limit copying to trivially copyable types Is this a pasto? The list seems to be in the middle of some text. Thanks, - Tom > in this specific case, the value's parsed type is TYPE_CODE_INT, but > the function requires TYPE_CODE_REF. We need to account for the > reference. > > In value_arg_coerce, we have special handling for references, but it > has not specifically dealt with this case. It now checks if the > reference is in memory, and if it isn't, it copies it, if the type > is trivially copyable. > > As a result of this patch, the last remaining failure in c++/15372 is now > fixed, and that bug can be closed. > > With this patch, we can now print map entries with integer keys: > > (gdb) print int_map[1] > $1 = (std::map, std::allocator > >::mapped_type &) @0x41f2d4: 10 > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=15372 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25957 > --- > gdb/infcall.c | 21 ++- > gdb/testsuite/gdb.cp/ref-params.cc | 95 +++++++++++- > gdb/testsuite/gdb.cp/ref-params.exp | 146 +++++++++++++++++++ > gdb/testsuite/gdb.cp/rvalue-ref-overload.exp | 1 - > 4 files changed, 256 insertions(+), 7 deletions(-) > > diff --git a/gdb/infcall.c b/gdb/infcall.c > index 51636ff5403..03fbebf8782 100644 > --- a/gdb/infcall.c > +++ b/gdb/infcall.c > @@ -246,7 +246,8 @@ show_unwind_on_timeout_p (struct ui_file *file, int from_tty, > > static struct value * > value_arg_coerce (struct gdbarch *gdbarch, struct value *arg, > - struct type *param_type, int is_prototyped) > + struct type *param_type, int is_prototyped, > + CORE_ADDR &sp, struct thread_info *call_thread) > { > const struct builtin_type *builtin = builtin_type (gdbarch); > struct type *arg_type = check_typedef (arg->type ()); > @@ -276,10 +277,20 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg, > return value_cast_pointers (type, arg, 0); > > /* Cast the value to the reference's target type, and then > - convert it back to a reference. This will issue an error > - if the value was not previously in memory - in some cases > - we should clearly be allowing this, but how? */ > + convert it back to a reference. If the value is not already > + in memory (e.g., a literal), we need to allocate space in the > + inferior and copy it there. */ > new_value = value_cast (type->target_type (), arg); > + if (new_value->lval () != lval_memory > + && (language_pass_by_reference (new_value->type ()) > + .trivially_copyable)) > + { > + LONGEST length = check_typedef (new_value->type ())->length (); > + struct value *addr_val = value_allocate_space_in_inferior (length); > + CORE_ADDR addr = value_as_address (addr_val); > + new_value->force_lval (addr); > + } > + > new_value = value_ref (new_value, type->code ()); > return new_value; > } > @@ -1335,7 +1346,7 @@ call_function_by_hand_dummy (struct value *function, > > value *original_arg = args[i]; > args[i] = value_arg_coerce (gdbarch, args[i], > - param_type, prototyped); > + param_type, prototyped, sp, call_thread.get ()); > > if (param_type == NULL) > continue; > diff --git a/gdb/testsuite/gdb.cp/ref-params.cc b/gdb/testsuite/gdb.cp/ref-params.cc > index 12e2716b435..3c1aa82396a 100644 > --- a/gdb/testsuite/gdb.cp/ref-params.cc > +++ b/gdb/testsuite/gdb.cp/ref-params.cc > @@ -60,6 +60,68 @@ int mf2(MultiChild& C) > return mf1(C); > } > > +/* A class to be used by functions and methods exercising c++/25957. */ > +class TestClass > +{ > + public: > + int value; > + > + TestClass (int v) : value (v) {} > + > + int > + const_ref_method (const int &x) const > + { > + return value + x; > + } > + > + int > + const_ref_method (const TestClass &obj) const > + { > + return value + obj.value; > + } > + > + int > + ref_method (int &x) > + { > + return value + 2 * x; > + } > + > + int > + ref_method (TestClass &obj) > + { > + return value + 2 * obj.value; > + } > +}; > + > +/* Define globals to be used by functions and methods exercising c++/25957. */ > +int global_int = 42; > +TestClass global_obj (10); > + > +/* Helper functions to test reference parameter behavior for c++/25957. */ > +int > +const_ref_func (const int &x) > +{ > + return x * 2; > +} > + > +int > +const_ref_func (const TestClass &obj) > +{ > + return obj.value * 2; > +} > + > +int > +ref_func (int &x) > +{ > + return x + 1; > +} > + > +int > +ref_func (TestClass &obj) > +{ > + return obj.value + 1; > +} > + > int main(void) > { > Child Q(42); > @@ -76,5 +138,36 @@ int main(void) > > mf2(MQ); /* Set breakpoint MQ here. */ > > - return 0; > + TestClass obj (5); > + int local_var = 15; > + > + /* Prevent compiler from optimizing away the function and method calls. */ > + int dummy_int = 99; > + (void) const_ref_func (dummy_int); > + (void) const_ref_func (global_int); > + (void) const_ref_func (obj); > + (void) const_ref_func (global_obj); > + (void) ref_func (dummy_int); > + (void) ref_func (global_int); > + (void) ref_func (obj); > + (void) ref_func (global_obj); > + (void) obj.const_ref_method (dummy_int); > + (void) obj.const_ref_method (global_int); > + (void) obj.const_ref_method (obj); > + (void) obj.const_ref_method (global_obj); > + (void) obj.ref_method (dummy_int); > + (void) obj.ref_method (global_int); > + (void) obj.ref_method (obj); > + (void) obj.ref_method (global_obj); > + (void) global_obj.const_ref_method (dummy_int); > + (void) global_obj.const_ref_method (global_int); > + (void) global_obj.const_ref_method (obj); > + (void) global_obj.const_ref_method (global_obj); > + (void) global_obj.ref_method (dummy_int); > + (void) global_obj.ref_method (global_int); > + (void) global_obj.ref_method (obj); > + (void) global_obj.ref_method (global_obj); > + > + /* Breakpoint here for c++/25957 testing. */ > + return 0; /* breakpoint-here */ > } > diff --git a/gdb/testsuite/gdb.cp/ref-params.exp b/gdb/testsuite/gdb.cp/ref-params.exp > index b61055e9f50..31144fcba21 100644 > --- a/gdb/testsuite/gdb.cp/ref-params.exp > +++ b/gdb/testsuite/gdb.cp/ref-params.exp > @@ -63,3 +63,149 @@ gdb_test "print f1(MQR)" ".* = 53" > gdb_test "print mf1(MQR)" ".* = 106" > gdb_test "print mf2(MQR)" ".* = 106" > gdb_test "print f3(Q.id)" ".* = 42" > + > +# Inferior function call tests which have reference arguments. > +# https://sourceware.org/bugzilla/show_bug.cgi?id=25957 > +gdb_start_again "breakpoint-here" > + > +# Test functions taking const reference parameter. > +gdb_test "print const_ref_func(10)" \ > + "= 20" \ > + "call function with const ref param and literal" > + > +gdb_test "print const_ref_func(global_int)" \ > + "= 84" \ > + "call function with const ref param and global variable" > + > +gdb_test "print const_ref_func(local_var)" \ > + "= 30" \ > + "call function with const ref param and local variable" > + > +gdb_test "print const_ref_func(obj)" \ > + "= 10" \ > + "call function with const ref param and object" > + > +gdb_test "print const_ref_func(global_obj)" \ > + "= 20" \ > + "call function with const ref param and global object" > + > +gdb_test "print const_ref_func((TestClass) {42})" \ > + "= 84" \ > + "call function with const ref param and literal object" > + > +# Test functions taking non-const reference parameter. > +gdb_test "print ref_func(10)" \ > + "Cannot resolve function ref_func to any overloaded instance" \ > + "call function with non-const ref param and literal" > + > +gdb_test "print ref_func(global_int)" \ > + " = 43" \ > + "call function with non-const ref param and global variable" > + > +gdb_test "print ref_func(local_var)" \ > + " = 16" \ > + "call function with non-const ref param and local variable" > + > +gdb_test "print ref_func(obj)" \ > + "= 6" \ > + "call function with non-const ref param and object" > + > +gdb_test "print ref_func(global_obj)" \ > + "= 11" \ > + "call function with non-const ref param and global object" > + > +gdb_test "print ref_func((TestClass) {42})" \ > + "Cannot resolve function ref_func to any overloaded instance" \ > + "call function with ref param and literal object" > + > +# Test methods taking constant reference parameter. > +gdb_test "print obj.const_ref_method(5)" \ > + "= 10" \ > + "call const method with const ref param and literal" > + > +gdb_test "print obj.const_ref_method(global_int)" \ > + "= 47" \ > + "call const method with const ref param and global variable" > + > +gdb_test "print obj.const_ref_method(local_var)" \ > + "= 20" \ > + "call const method with const ref param and local variable" > + > +gdb_test "print obj.const_ref_method(obj)" \ > + "= 10" \ > + "call method with const ref param and object" > + > +gdb_test "print obj.const_ref_method((TestClass) {42})" \ > + "= 47" \ > + "call method with const ref param and literal object" > + > +# Test methods taking non-const reference parameters. > +gdb_test "print obj.ref_method(5)" \ > + "Cannot resolve method TestClass::ref_method to any overloaded instance" \ > + "call method with non-const ref param and literal" > + > +gdb_test "print obj.ref_method(global_int)" \ > + "= 89" \ > + "cal method with non-const ref param and global variable" > + > +gdb_test "print obj.ref_method(local_var)" \ > + " = 35" \ > + "call method with non-const ref param and local variable" > + > +gdb_test "print obj.ref_method(obj)" \ > + "= 15" \ > + "call method with non-const ref param and object" > + > +gdb_test "print obj.ref_method((TestClass) {42})" \ > + "Cannot resolve method TestClass::ref_method to any overloaded instance" \ > + "call method with non-const ref param and literal object" > + > +# Test global_obj methods taking constant reference parameter. > +gdb_test "print global_obj.const_ref_method(5)" \ > + "= 15" \ > + "call global const method with const ref param and literal" > + > +gdb_test "print global_obj.const_ref_method(global_int)" \ > + "= 52" \ > + "call global const method with const ref param and global variable" > + > +gdb_test "print global_obj.const_ref_method(local_var)" \ > + "= 25" \ > + "call global const method with const ref param and local variable" > + > +gdb_test "print global_obj.const_ref_method(obj)" \ > + "= 15" \ > + "call global method with const ref param and object" > + > +gdb_test "print global_obj.const_ref_method(global_obj)" \ > + "= 20" \ > + "call global method with const ref param and global object" > + > +gdb_test "print global_obj.const_ref_method((TestClass) {42})" \ > + "= 52" \ > + "call global method with const ref param and literal object" > + > +# Test global_obj methods taking non-const reference parameters. > +gdb_test "print global_obj.ref_method(5)" \ > + "Cannot resolve method TestClass::ref_method to any overloaded instance" \ > + "call global method with non-const ref param and literal" > + > +gdb_test "print global_obj.ref_method(global_int)" \ > + "= 94" \ > + "call global method with non-const ref param and global variable" > + > +gdb_test "print global_obj.ref_method(local_var)" \ > + "= 40" \ > + "call global method with non-const ref param and local variable" > + > +gdb_test "print global_obj.ref_method(obj)" \ > + "= 20" \ > + "call global method with non-const ref param and object" > + > +gdb_test "print global_obj.ref_method(global_obj)" \ > + "= 30" \ > + "call global method with non-const ref param and global object" > + > +gdb_test "print global_obj.ref_method ((TestClass) {42})" \ > + "Cannot resolve method TestClass::ref_method to any overloaded instance" \ > + "call global method with non-const ref param and literal object" > diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp > index bd6933673db..b9da32c244e 100644 > --- a/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp > +++ b/gdb/testsuite/gdb.cp/rvalue-ref-overload.exp > @@ -64,7 +64,6 @@ gdb_test "print f (i)" "1" "lvalue reference overload" > > gdb_test "print f (ci)" "2" "lvalue reference to const overload" > > -setup_kfail "c++/15372" "*-*-*" > gdb_test "print f (3)" "3" "rvalue reference overload" > > gdb_test "print g (i)" \ > > base-commit: 8bdf98b14364adb3f3e90b0a5a08b4a6c8e07fe7