Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Fix gdb.cp/break-f-std-string.cc with older gcc
Date: Thu, 12 May 2022 13:47:26 +0100	[thread overview]
Message-ID: <60c929b0-f7e1-c0a7-ce44-daa06dbc860f@palves.net> (raw)
In-Reply-To: <20220512114555.GA21719@delia>

On 2022-05-12 12:45, Tom de Vries wrote:

> [gdb/testsuite] Fix gdb.cp/break-f-std-string.cc with older gcc
> 
> ---
>  gdb/testsuite/gdb.cp/break-f-std-string.cc | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.cp/break-f-std-string.cc b/gdb/testsuite/gdb.cp/break-f-std-string.cc
> index 454ab4c42ea..cbbfeebac60 100644
> --- a/gdb/testsuite/gdb.cp/break-f-std-string.cc
> +++ b/gdb/testsuite/gdb.cp/break-f-std-string.cc
> @@ -17,6 +17,20 @@
>  
>  #include <string>
>  
> +#if _GLIBCXX_USE_CXX11_ABI == 1
> +#if defined (__GNUC__) && (__GNUC__ >= 5) && (__GNUC__ <= 8)
> +
> +// Work around missing std::string typedef before gcc commit
> +// "Define std::string and related typedefs outside __cxx11 namespace".

Since we try to follow the GDB conventions in the tests too, this should
use /**/ comments.

> +
> +namespace std {
> +using namespace __cxx11;

Why is this "using namespace __cxx11;" needed?  I guess something about the
"related typedefs" mentioned in the comment?  The test passes for me without
that, on GCC 6.5 (the only affected compiler I have handy atm), like:

namespace std {
typedef __cxx11::string string;
}

Otherwise LGTM.

Pedro Alves

> +typedef __cxx11::string string;
> +}
> +
> +#endif
> +#endif
> +
>  void
>  f (std::string s)
>  {
> 


  reply	other threads:[~2022-05-12 13:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 11:45 Tom de Vries via Gdb-patches
2022-05-12 12:47 ` Pedro Alves [this message]
2022-05-12 12:57   ` Tom de Vries 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=60c929b0-f7e1-c0a7-ce44-daa06dbc860f@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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