This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved
- From: Ian Lance Taylor <iant at google dot com>
- To: tbp <tbptbp at gmail dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Fri, 10 Sep 2010 08:20:03 -0700
- Subject: Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved
- References: <AANLkTim_pauFqqD2MRhxzAqqr9gMarR_oOVnpZ98=d4a@mail.gmail.com>
tbp <tbptbp@gmail.com> writes:
> Since about 2010/09/07 i've had a weird error with a mismatched
> prototype involving an argument once forward declared as 'class foo;'
> and later defined as 'class __attribute((aligned(16))) foo {...};', a
> bit like
> namespace n1 {
> class fwd;
> namespace n2 {
> class foo {
> void bar(fwd &);
> };
> }
> class __attribute((aligned(16))) fwd {};
> }
> // error prototype for... candidate is... would be here.
> void n1::n2::foo::bar(n1::fwd &) {}
>
> Except that's no testcase because it works: to kludge around, i have
> to forward declare with matching attributes (or get an error).
> I fail to reduce it, and the source code is large & fugly; i'd prefer
> not to have to disclose, hence no formal bug report.
> My hope being that will ring a bell for whoever's responsible :)
>
> PS: x86-64/32, linux, -std=c++0x.
I understand what you are trying to do, but it's very unlikely that
anybody will be able to solve this problem without a test case. Since
you do have a test case, you could try using a tool like delta to reduce
it to something that you can share.
Ian