From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Fix gdb.base/condbreak-multi-context.exp with gcc 4.8.5
Date: Thu, 15 Dec 2022 12:30:59 +0100 [thread overview]
Message-ID: <20221215113059.32184-1-tdevries@suse.de> (raw)
With gcc 4.8.5, I run into:
...
Running gdb.base/condbreak-multi-context.exp ...
gdb compile failed, condbreak-multi-context.cc:21:11: warning: non-static \
data member initializers only available with -std=c++11 or -std=gnu++11 \
[enabled by default]
int b = 20;
^
...
Fix this by making it a static const.
Tested on x86_64-linux, with gcc 4.8.5, 7.5.0 and clang 13.0.1.
---
gdb/testsuite/gdb.base/condbreak-multi-context.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.base/condbreak-multi-context.cc b/gdb/testsuite/gdb.base/condbreak-multi-context.cc
index 0192478f0d2..914c003b00f 100644
--- a/gdb/testsuite/gdb.base/condbreak-multi-context.cc
+++ b/gdb/testsuite/gdb.base/condbreak-multi-context.cc
@@ -18,7 +18,7 @@
class Base
{
public:
- int b = 20;
+ static const int b = 20;
void func () {}
};
@@ -26,7 +26,7 @@ public:
class A : public Base
{
public:
- int a = 10;
+ static const int a = 10;
void func () {}
};
@@ -34,7 +34,7 @@ public:
class C : public Base
{
public:
- int c = 30;
+ static const int c = 30;
void func () {}
};
base-commit: 9c71ba0dc4f4ad7ab7e5f7711be6e7fde6118a06
--
2.35.3
reply other threads:[~2022-12-15 11:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221215113059.32184-1-tdevries@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).