From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YSSiKRM8amprdjMAWB0awg (envelope-from ) for ; Wed, 29 Jul 2026 13:44:51 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWEArNlT; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id A63701E099; Wed, 29 Jul 2026 13:44: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=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,WEIRD_PORT autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 1EAA81E099 for ; Wed, 29 Jul 2026 13:44:51 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F10954BB5915 for ; Wed, 29 Jul 2026 17:44:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F10954BB5915 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWEArNlT Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 8B0D94BB3BC1 for ; Wed, 29 Jul 2026 17:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B0D94BB3BC1 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8B0D94BB3BC1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785347065; cv=none; b=kZ2IsnEiFJNP46p+UR7RJmkRexZFFEiP7nLK6Cg0ETxBPzQAFGSnuYQ3Oxglxq6V8U1k37j2s+Q+suz/t+esSnI4r7Tq9UTG71aO1TyYGBJyYutBVEB2U/HAYsVNdGYpWNK07bT0tKIBJoZENT9HrQuU9ME55Axbp8oIwa2ewe8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785347065; c=relaxed/simple; bh=T/oqHkTC6j0VRWh9B1nxWcSR/S7Hikbb4qRo27nJlNE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=O47aQF3A2b6ZOZkFCa83/yXxZCDkrPObWGonhmhHIShSwM9kxrmQSe+vuj3xldOLJoMaxztX0UC5KtvGhQy1IOOnsJDeruCRsf7y0EZydQHhhjQL3mK2GO/ROXrJpVEkawML37IsEPX5o6m6QgHJvanjOoJwk79KdLUH4pfVaL0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWEArNlT DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B0D94BB3BC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785347065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ps2O1RdFIcb8U9LfJbIge6PanTjSanI6SKWGx6WWD70=; b=XWEArNlTq4IYqu3KbXxOkzQwfkjrOrEvVZYevWnhxPa3OvP0JQJ2qWV4c1tgT/IELPzLYj KJuUPCVxwsJEOdFBafal8u8sipZdwkqZOTV4Fn81UwF5Xb4dt+DOdKoxxZnj7p8vol8Syr 15X1Xy3H88K6U5SUQBqqwVBv9MeNV6w= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-yGs72a2VMxiwyea67q53vA-1; Wed, 29 Jul 2026 13:44:23 -0400 X-MC-Unique: yGs72a2VMxiwyea67q53vA-1 X-Mimecast-MFC-AGG-ID: yGs72a2VMxiwyea67q53vA_1785347063 Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-8487ed7f7beso1313109b3a.0 for ; Wed, 29 Jul 2026 10:44:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785347063; x=1785951863; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Ps2O1RdFIcb8U9LfJbIge6PanTjSanI6SKWGx6WWD70=; b=JfZSgRhXT2FyO0GllK1l/9vAAAJ32QVMuuiTlKDRDUdFuUSK9+1+YnB/gxFMTEzqNR BG+vMUxXMOGoDXTahDNB+ojt7iWdZfHIIn43sHK6SNcWpdgehvdiqMaXO4wUlbCbIDus K4+rMeqJRKB9tRhsnlZgRpwECXSY6LNC8xgH9mfqGt6KOc64+lyLE7wcUGssfE3rI4to wfar1nnvXWzllIblEiao6y3FQcB25f/N7kBwB+nXcCWf6+DQA5uOgrcYNLl84hNy1kwN iv7jOKcpUAPtHRLihnGcKWudjAs/lV1NaACsgkggXCFqyOhIlyIqTcUAe+XELCzOCvYn zFKw== X-Gm-Message-State: AOJu0YwOood5xMKL/UDAmoP+unU2GVECnWkx+Qe+HLhtuEB/cCjalHSI r7L1DvcwUfUaUU68lM9JsO3HeIrZwQHYbAMoHiPQh4zL48FQc6zwf4cUcEm5FzGscNw2nvuJixk 8WlhEcwp95zu+GbNX5z6MJ7qFwsL/dEHWO80uwwgvUWnzqFfeJT2HuuDBfJF99Yc= X-Gm-Gg: AR+sD10Bb+WaGQHlGZFe6oc8+b38iQ4d4U93PXrh+tAceAwMg24MsMm+yBcXjZbO1/y Px3G9R1x25k3eOhdgAK0zbRtjG2s0v8wws9wW61h14te+ku0F+yBBERVOpVSdDjv1aw7Shi3lE8 OJIAMvytSJLDIBTa85EqmgqfB9fGBeSIhtgK32yRTMpt3XrfOAF5eo5GdCQ3LTfwNyqcMBtPO6j nXsw6o5yy/064rgv6Uctf6PYhvOulj5CjNvgGxUqSnuFE6FDlj1AQ0dR94rnZaR3UhEs2jq3nvb Qnevn1Fusbd4wWuuGovPAUqNXsy8bYutQIL2g151czDYTIiiCcAZC4JF+iydljS3fSGrrC2Dgsm eEJT4Vb8= X-Received: by 2002:a05:6a00:3c8b:b0:848:4080:afe8 with SMTP id d2e1a72fcca58-84e9331494dmr8374578b3a.22.1785347062631; Wed, 29 Jul 2026 10:44:22 -0700 (PDT) X-Received: by 2002:a05:6a00:3c8b:b0:848:4080:afe8 with SMTP id d2e1a72fcca58-84e9331494dmr8374559b3a.22.1785347062156; Wed, 29 Jul 2026 10:44:22 -0700 (PDT) Received: from [150.1.200.157] ([172.56.105.224]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84ea03869d2sm1727421b3a.49.2026.07.29.10.44.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Jul 2026 10:44:21 -0700 (PDT) Message-ID: Date: Wed, 29 Jul 2026 10:44:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Keith Seitz Subject: Re: [PATCH v2] Add infcall support for C++ constructor-style expressions To: Kevin Buettner Cc: gdb-patches@sourceware.org References: <20260626170308.69c33832@f44-mesa-1> In-Reply-To: <20260626170308.69c33832@f44-mesa-1> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: heBOArGie2GT4eMZGVgMhsL6yAvhVzIJi-j91B4rfY0_1785347063 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Hi, On 6/26/26 5:06 PM, Kevin Buettner wrote: > > Claude found this problem... > > (gdb) file /tmp/test_c > Reading symbols from /tmp/test_c... > (gdb) start > Temporary breakpoint 1 at 0x40044a: file /tmp/test_c.c, line 2. > Starting program: /tmp/test_c > > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/libthread_db.so.1". > > Temporary breakpoint 1, main () at /tmp/test_c.c:2 > 2 int main() { struct S s = {42}; return s.x; } > (gdb) print typeof(struct S)(42) > /home/kevinb-claude/binutils-gdb-patch-review/gdb/eval.c:1885: internal-error: evaluate_funcall: Assertion `exp->language_defn->la_language == language_cplus' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > ----- Backtrace ----- > 0x51e699 gdb_internal_backtrace_1 > /home/kevinb-claude/binutils-gdb-patch-review/gdb/bt-utils.c:122 > 0x51e699 _Z22gdb_internal_backtracev > /home/kevinb-claude/binutils-gdb-patch-review/gdb/bt-utils.c:173 > 0x9fb874 internal_vproblem > /home/kevinb-claude/binutils-gdb-patch-review/gdb/utils.c:434 > 0x9fbd38 _Z15internal_verrorPKciS0_P13__va_list_tag > /home/kevinb-claude/binutils-gdb-patch-review/gdb/utils.c:514 > 0xb6cea1 _Z18internal_error_locPKciS0_z > /home/kevinb-claude/binutils-gdb-patch-review/gdbsupport/errors.cc:57 > 0x67e31c _ZN4expr14type_operation16evaluate_funcallEP4typeP10expression6nosideRKSt6vectorISt10unique_ptrINS_9operationESt14default_deleteIS8_EESaISB_EE > ... > Thanks for the report. The root cause is that the C++-only gate lived only in the lexer, but `typeof(T)` is a separate `type_exp` production. So in C, `typeof(struct S)(42)` still matched the general `type_exp '(' arglist ')'` rules, built a `funcall_operation`, and hit the `language_cplus` assert in `type_operation::evaluate_funcall`. The fix is to mirror the lexer gate in those parser actions: if the language is not C++, throw an error: (gdb) print typeof(struct S)(42) Constructor-style casts are only valid in C++ I left the `type_exp`-based productions in place rather than splitting out a dedicated ctor non-terminal; the language check closes the hole Claude found without that larger grammar change. I'm happy to revisit the shift/reduce side separately if consensus is reached. [This is the direction a previous review steered me, and I am happy to revisit that initial review recommendation.] Thank you, Keith