public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Enze Li <lienze2010@hotmail.com>
To: Tom Tromey <tromey@adacore.com>, Simon Marchi <simon.marchi@polymtl.ca>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Add initializers to bound_minimal_symbol
Date: Wed, 16 Feb 2022 22:31:20 +0800	[thread overview]
Message-ID: <MEAP282MB02938322FF90AADA96CFECC0DD359@MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <877d9wrvb7.fsf@tromey.com>

Hi Tom,

I also encountered a similar error message when I compiled with clang.Then I found this thread that you are discussing. 

I use the following commands to build,
$ ./configure --prefix=`pwd`/build CC=clang CXX=clang++ \
  CXXFLAGS=-std=gnu++11 --disable-unit-tests

It says,
=====================================================================
  CXX    macroscope.o
linespec.c:4276:31: error: no matching constructor for initialization
of 'struct bound_minimal_symbol'
  struct bound_minimal_symbol mo = {minsym, objfile};
                              ^    ~~~~~~~~~~~~~~~~~
./minsyms.h:29:8: note: candidate constructor (the implicit copy
constructor) not viable: requires 1 argument, but 2 were provided
struct bound_minimal_symbol
       ^
./minsyms.h:29:8: note: candidate constructor (the implicit move
constructor) not viable: requires 1 argument, but 2 were provided
./minsyms.h:29:8: note: candidate constructor (the implicit default
constructor) not viable: requires 0 arguments, but 2 were provided
=====================================================================

On Tue, 2022-02-15 at 08:41 -0700, Tom Tromey via Gdb-patches wrote:
> Simon> Hmm, I see this with g++-11:
> 
> I'm also using gcc 11 and I don't see this error.

It seems that Simon is referring to the use of the C++11 standard.

> 
> Simon> Not sure what's the best way to fix this, possibly to
> addconstructors
> Simon> to bound_minimal_symbols.
> 
> I wrote the appended and this also built fine.  But I don't know ifit
> would work for you.
> 
> Tom

With the appended patch, it built fine for me with clang.  And I also
tested it with gcc-11 as Simon did and again there were no problems.

$ ./configure --prefix=`pwd`/build CXXFLAGS=-std=gnu++11 \
  --disable-unit-tests

BTW, all tests were conducted on the latest openSUSE Tumbleweed.
It has:
- gcc (SUSE Linux) 11.2.1 20220103
- clang version 13.0.1

Thanks for fixing this.

Cheers!
Enze
 

  reply	other threads:[~2022-02-16 14:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 20:42 Tom Tromey
2022-02-11 13:34 ` Simon Marchi
2022-02-14 15:53   ` Simon Marchi
2022-02-15 15:41     ` Tom Tromey
2022-02-16 14:31       ` Enze Li [this message]
2022-02-16 15:29         ` Simon Marchi
2022-02-16 20:47           ` Tom Tromey

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=MEAP282MB02938322FF90AADA96CFECC0DD359@MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM \
    --to=lienze2010@hotmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=tromey@adacore.com \
    /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).