|
From: | Florian Kainz |
Subject: | Re: [Openexr-devel] Compiling with gcc4.0.1 - compilation error andfix |
Date: | Tue, 19 Jul 2005 15:52:48 -0700 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 |
Bob Friesenhahn wrote:
On Tue, 19 Jul 2005, Kevin Wheatley wrote:Florian Kainz wrote:Thank you for pointing this out. I think this is a bug in gcc 4.0.1; you should probably report it to the gcc maintainers.I don't think it is a bug, at least according to the C++ standard. If no Image is in scope at the point of the friend declaration, it is going to inject the Image class into the ImageChannel scope. This is different to the pre-standard ARM, where it would have injected it into the innermost non class scope (from memory my ARM is at home :-)I must agree that GCC 4.0.1 is doing the right thing here and the code has a bug.The error/warning capabilities of GCC 4.X are a clear improvement over its predecessors.
The proposed fix for exrmaketiled is harmless one way or the other, and changing the code won't create a problem. However, I still maintain that there is a bug in gcc 4.0.1 that should be reported. Section 11.4, clause 2 (page 180) of ISO/IEC 14882 contains two code examples. Here's one of them: class X { enum { a = 100; } friend class Y; }; class Y { int v[X::a]; // OK, Y is a friend of X }; ... Note that there is no forward declaration of Y before X. Does gcc 4.0.1 give an error message for the example above? Florian
[Prev in Thread] | Current Thread | [Next in Thread] |