------- Additional Comments From fang at csl dot cornell dot edu 2005-02-27
06:25 -------
1) Has anyone figured out a workaround to this yet? I suppose I could remove
some using
namespace declarations and prefix type names with namespaces... I'll keep
tinkering around.
2) New and perhaps closely related bug?
g++-4.0 is also rejecting-valid the following code, tweaked from Andrew's
example to reproduce
something else I'm doing in my project: (using same version info as reported
here)
//-------------- snip ---------------
namespace util
{
class persistent_object_manager;
namespace memory
{
class pointer_manipulator
{
friend class persistent_object_manager;
};
}
}
namespace util
{
using namespace memory;
class persistent_object_manager
{
static const int foo;
};
}
namespace util {
const int
persistent_object_manager::foo = 666;
}
//--------------- end snip ----------------
g++-4.0 -c blah.cc -o blah.o
reports:
blah.cc:24: error: 'persistent_object_manager' has not been declared
whereas 3.3 and 3.4 accept the code.
Removing the friend declaration on line 8 allows g++-4.0 to compile.
Removing the using namespace memory line 14 also allows g++-4.0 to compile.
It was difficult to find a bug in the bugzilla database with the same
characteristics.
Should I file a separate bug report for this one or just tack it on to this one
because it's probably closely
related?
-- David
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19948