From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yptlEa1pAGA/JwAAWB0awg (envelope-from ) for ; Thu, 14 Jan 2021 10:56:29 -0500 Received: by simark.ca (Postfix, from userid 112) id 3B30D1EF80; Thu, 14 Jan 2021 10:56:29 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7029F1E940 for ; Thu, 14 Jan 2021 10:56:28 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A030A397183F; Thu, 14 Jan 2021 15:56:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A030A397183F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610639787; bh=wquGvW8BllJL0S84DOVEGmQsPEy0m8jEuHkuQoT0zos=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=W7bm34TZa3qpOppPVFmWJW010VfGBAOlT6LvhQjJABwODChjlHCLR/418fV3XVe8c IPjtN6IN1bhTUMwFVPC1f+httKakH1Pc4XZz+Wv81YKnYleh+k3Lu0A7oIkkZuTJn5 4VD+3E+l9GxntcqD0mWANccKNFav6vUIVK80Ehhg= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 74A95397183A for ; Thu, 14 Jan 2021 15:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 74A95397183A Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 10EFuGCY024169 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Jan 2021 10:56:21 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10EFuGCY024169 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 698171E940; Thu, 14 Jan 2021 10:56:16 -0500 (EST) Subject: Re: [PATCH] Fix building gdb with gcc-4.x To: Bernd Edlinger , "gdb-patches@sourceware.org" , Luis Machado References: <13ad5646-78f6-27dc-2e26-f250bb4b8c52@polymtl.ca> Message-ID: <9597d6b0-eba7-3a61-ab41-a288240b8041@polymtl.ca> Date: Thu, 14 Jan 2021 10:56:16 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 14 Jan 2021 15:56:16 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-14 1:36 a.m., Bernd Edlinger wrote: > On 1/4/21 10:30 PM, Simon Marchi wrote: >> On 2021-01-04 3:57 p.m., Bernd Edlinger wrote: >>> Hi, >>> >>> with Luis' commit of today the trunk is no longer able to >>> be compiled with gcc-4.x. >>> >>> The problem is std::is_trivially_default_constructible is >>> not defined before gcc-5 although the compiler supports C++11 >>> >>> I am not sure about what's the best approach for conditionally >>> enabling the code, especially for compilers other than g++. >>> >>> >>> This fixes the build for me. >>> Is it OK for trunk? >>> >>> >>> Thanks >>> Bernd. >>> >> >> We have other instances of this, I'd suggest inspiring yourself from: >> >> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/unittests/enum-flags-selftests.c;h=e3b6cf81d07f1eaefec72bce131d1c75ce00ef82;hb=HEAD#l66 >> >> These defines are defined here: >> >> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdbsupport/traits.h;h=f545edbb0d93e95f65e954fbf54cbc8843e5239a;hb=HEAD#l28 >> >> As you see, we already have a HAVE_IS_TRIVIALLY_CONSTRUCTIBLE, we could >> use it. The code in trad-frame.c could be changed to use >> std::is_trivially_constructible instead of >> std::is_trivially_default_constructible, I believe it's the same when >> passing no Args... to is_trivially_constructible. See "Possible >> implementation" in: >> >> https://en.cppreference.com/w/cpp/types/is_default_constructible >> >> Simon >> > > Okay, good point. > > I updated the patch following your suggestion. > > Is the updated patch OK? > > > Thanks > Bernd. > Yep, LGTM, thanks. Simon