[Bug c++/19948] [4.0/4.1 Regression] ICE: tree check: expected class 'declaration', have 'exceptional' (error_mark) in pushtag, at cp/name-lookup.c:4658
fang at csl dot cornell dot edu
gcc-bugzilla@gcc.gnu.org
Sun Feb 27 17:15:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list