On Fri, Feb 13, 2009 at 8:53 AM, Anthony Newnam <anth...@bnovc.com> wrote:
> I asked on gcc-help, but it seems like this list may be more
> appropriate as it deals with the gcc source.
>
> I have noticed that in my g++ <4.3.0, I am able to compile the
> following code without any errors:
> struct A;
> void foo(A);
> void bar(A* p){foo(*p);}
>
> In g++ 4.3.0 this seems to have been fixed, but I'm having a very hard
> time locating the fix for it. I was hoping that someone could point me
> in a general direction and hopefully even a changeset. I would like to
> be able to backport this to g++ 4.1.2 if possible.
>

FWIW, it failed with gcc 3.4.6 on RHEL4 and gcc 4.1.2 on RHEL5:

bad.cc: In function `void bar(A*)':
bad.cc:3: error: invalid use of undefined type `struct A'
bad.cc:1: error: forward declaration of `struct A'
bad.cc:3: error:   initializing argument 1 of `void foo(A)'

-- 
H.J.

Reply via email to