[CLN-list] patch for cln with gcc-4

Richard B. Kreckel kreckel at ginac.de
Mon Apr 18 21:20:41 CEST 2005


Hi Ralf!

On Mon, 18 Apr 2005, Ralf Wildenhues wrote:
[...]
> This compiler is straight from CVS HEAD (that day).  Sorry for not
> noticing that I had left 4.0.0 CVS now.  So, again CLN brings out
> another compiler issue (ok, we don't know yet who is at fault :).

GCC's, methinks.   :)

> The only related change a cursory search gives me is this:
> http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01244.html
>
>
> So, let's look at this simple test case:
>
> class X {
>   friend class Y;
>   friend int foo(const Y&);
> };
>
> is marked as erroneous:
> a.cc:3: error: expected ‘,’ or ‘...’ before ‘&’ token
> a.cc:3: error: ISO C++ forbids declaration of ‘Y’ with no type

It contradicts 11.4/7 of the standard: "A name nominated by a friend
declaration shall be accessible in the scope of the class containing the
friend declaration."

[...]
> I am by no means a C++ expert.  You decide what to do.  :)
> (I can ask on one of the gcc lists if you want to, but only if someone
> explains to me why gcc should be wrong.)

Could you, please, rather file a PR in GCC's bugzilla?

Thanks
  -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>





More information about the CLN-list mailing list