Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved

2010-09-14 Thread tbp
On Tue, Sep 14, 2010 at 4:51 PM, Ian Lance Taylor  wrote:
> Please do file a PR if there isn't one already.  Thanks.
I have no idea if that could happen outside C++ and couldn't find
anything relevant, thus
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45668
That's the best i can do.
And thanks for your assistance.


Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved

2010-09-14 Thread Ian Lance Taylor
tbp  writes:

> Would it be possible to have some clarifications? Shall i file a PR
> for a warning? Sacrifice a goat?

Please do file a PR if there isn't one already.  Thanks.

Ian


Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved

2010-09-14 Thread tbp
Hello,
i know it's no good form to reply to self, or be that insistent, but
i've been hit again.

In the bug report discussion, i've been told by A. Pinski that, as of
now, forward declarations shall have matching attributes. That's fine,
i suppose. What's not is that:
 . that new behavior, as far as i know, isn't documented anywhere.
 . there's no warning or error at the declaration/definition point.
 . it's not consistent (non-compliance only fail in some unknown condition).
 . when you finally get an error, it will be about a vaguely related
prototype mismatch somewhere.

Would it be possible to have some clarifications? Shall i file a PR
for a warning? Sacrifice a goat?

PS: now i know better, but i can assure you, anyone running into that
issue is bound to waste tremendous amounts of time trying to figure
out what's wrong with their prototype.


Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved

2010-09-10 Thread tbp
On Fri, Sep 10, 2010 at 5:20 PM, Ian Lance Taylor  wrote:
> Since you do have a test case, you could try using a tool like delta to reduce
> it to something that you can share.
My delta-fu is too weak to get anywhere with an error so easily
produced (mismatched prototype, plus g++ senseless diagnostic doesn't
help either).
I've given up and submitted http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45642.
But thanks for the input.


Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved

2010-09-10 Thread Manuel López-Ibáñez
On 10 September 2010 17:20, Ian Lance Taylor  wrote:
>
> 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.

http://gcc.gnu.org/bugs/minimize.html

Cheers,

Manuel.


Re: g++, trunk, recent weird mismatch for arguments with forwarded declaration when attributes are involved

2010-09-10 Thread Ian Lance Taylor
tbp  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