[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

2005-03-13 Thread lerdsuwa at gcc dot gnu dot org

--- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-03-13 
14:25 ---
Look like caused by my changes to pushtag.

-- 
   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |lerdsuwa at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2005-02-14 15:02:03 |2005-03-13 14:25:34
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19948


[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

2005-02-27 Thread giovannibajo at libero dot it

--- Additional Comments From giovannibajo at libero dot it  2005-02-27 
08:49 ---
Please, always fill a different bugreport for different testcases, unless you 
can prove it is exactly the same problem (and here you surely cannot). Then 
add references forth and back.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19948


[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

2005-02-27 Thread lerdsuwa at gcc dot gnu dot org

--- Additional Comments From lerdsuwa at gcc dot gnu dot org  2005-02-28 
06:22 ---
If you want a work around, simply use this in the first 'friend'
declaration:

  friend class util::persistent_object_manager;

There is still uncertainty about whether name from 'using' 
declaration/directive is allowed (DR138) so your workaround 
may not work in the future.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19948


[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

2005-02-26 Thread fang at csl dot cornell dot edu

--- 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


[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

2005-02-26 Thread fang at csl dot cornell dot edu

--- Additional Comments From fang at csl dot cornell dot edu  2005-02-27 
06:53 ---
Workaround discovered (shortly after I asked for one, fancy that!)

Declaring:

using util::persistent_object_manager;

inside the 'memory' namespace before the first friend declaration (after line 
5) results in correct output 
for the examples listed above.  The using declaration prevents (I think) 
injection of the friend class 
declaration into the 'memory' namespace and further confusion.  Not a bad idea 
in practice, actually.  

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19948