From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id AF03F3856962 for ; Fri, 19 May 2023 21:31:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF03F3856962 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684531906; 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=9IwiLMV6IFGaUw7bGhfzOMYLUvKm3SQmtcRmen+6utk=; b=Feez1POVSVOzk/83CzLLdcorkqWiPYTnW1mm+W9N83AtqsybWa/CiFHYTZ628MjAvcTk2l 0p8HGk2pTRXUv5S9ZjAH4ii2b3RiarTJDsU5Hlo+EcxzyluCc+VWrKrCgXAXrie7l508kv jZrp8IohbsupDGc3OwCWyQg4vxuc9d4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-e1AnVQHkM7SLXMwlj9Jnmg-1; Fri, 19 May 2023 17:31:44 -0400 X-MC-Unique: e1AnVQHkM7SLXMwlj9Jnmg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3750E80013A; Fri, 19 May 2023 21:31:44 +0000 (UTC) Received: from f38-zws-nv (unknown [10.22.32.62]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4E1040CFD46; Fri, 19 May 2023 21:31:43 +0000 (UTC) Date: Fri, 19 May 2023 14:31:42 -0700 From: Kevin Buettner To: Simon Marchi via Gdb-patches Cc: Simon Marchi Subject: Re: [PATCH] gdbsupport: add support for references to checked_static_cast Message-ID: <20230519143142.126781d9@f38-zws-nv> In-Reply-To: <20230518205737.403656-1-simon.marchi@efficios.com> References: <20230518205737.403656-1-simon.marchi@efficios.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 18 May 2023 16:57:37 -0400 Simon Marchi via Gdb-patches wrote: > Add a checked_static_cast overload that works with references. A bad > dynamic cast with references throws std::bad_cast, it would be possible > to implement the new overload based on that, but it seemed simpler to > just piggy back off the existing function. > > I found some potential uses of this new overload in amd-dbgapi-target.c, > update them to illustrate the use of the new overload. To build > amd-dbgapi-target.c, on needs the amd-dbgapi library, which I don't > expect many people to have. But I have it, and it builds fine here. I > did test the new overload by making a purposely bad cast and it did > catch it. I'm not especially knowledgeable in this area, but it LGTM. Acked-by: Kevin Buettner