Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Luis Machado <luis.machado@linaro.org>
Subject: Re: [PATCH] Fix building gdb with gcc-4.x
Date: Mon, 4 Jan 2021 16:30:11 -0500	[thread overview]
Message-ID: <13ad5646-78f6-27dc-2e26-f250bb4b8c52@polymtl.ca> (raw)
In-Reply-To: <AM0PR0602MB3410CF3FCFD75CC32A681896E4D20@AM0PR0602MB3410.eurprd06.prod.outlook.com>

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

  parent reply	other threads:[~2021-01-04 21:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 20:57 Bernd Edlinger
2021-01-04 21:16 ` Luis Machado via Gdb-patches
2021-01-04 21:34   ` Luis Machado via Gdb-patches
2021-01-04 21:30 ` Simon Marchi via Gdb-patches [this message]
2021-01-14  6:36   ` Bernd Edlinger
2021-01-14 15:56     ` Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13ad5646-78f6-27dc-2e26-f250bb4b8c52@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=bernd.edlinger@hotmail.de \
    --cc=luis.machado@linaro.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox