Skip to content

#1005 private members in SEntity (with clang)

Metadata

Property Value
Reported by Elias Pipping (elias.pipping@fu-berlin.de)
Reported at Dec 22, 2011 12:12
Type Bug Report
Version Git (pre2.4) [autotools]
Operating System Unspecified / All
Last edited by Christian Engwer (christi@conan.iwr.uni-heidelberg.de)
Last edited at Jan 26, 2012 13:30
Closed by Christian Engwer (christi@conan.iwr.uni-heidelberg.de)
Closed at Jan 26, 2012 13:30
Closed in version Unknown
Resolution Fixed
Comment fixed in dune-grid rev 7855

Description

clang complains about the following:

dune/grid/sgrid.hh:820:73: error: 'z' is a private member of 'Dune::SEntity<0, 3, const Dune::SGrid<3, 3, double> >' partition(_grid->partition(grid->getRealImplementation(ne).l,_self->z)),

dune/grid/sgrid.hh:1059:13: error: 'grid' is a private member of 'Dune::SEntity<0, 3, const Dune::SGrid<3, 3, double> >' grid(_e.grid), l(_e.l), index(_e.index),

dune/grid/sgrid.hh:1059:25: error: 'l' is a private member of 'Dune::SEntity<0, 3, const Dune::SGrid<3, 3, double> >' grid(_e.grid), l(_e.l), index(_e.index),

dune/grid/sgrid.hh:1059:38: error: 'index' is a private member of 'Dune::SEntity<0, 3, const Dune::SGrid<3, 3, double> >' grid(_e.grid), l(_e.l), index(_e.index),

The 'fix' is obvious:

<<SNIP --- a/dune/grid/sgrid.hh +++ b/dune/grid/sgrid.hh @@ -458,11 +458,11 @@ class SEntity<0,dim,GridImp> : public SEntityBase<0,dim,GridImp,SEntity> { enum { dimworld = GridImp::dimensionworld }; typedef Dune::SEntityBase<0,dim,GridImp,Dune::SEntity> SEntityBase; +public: using SEntityBase::grid; using SEntityBase::l; using SEntityBase::index; using SEntityBase::z; -public: typedef typename GridImp::ctype ctype; typedef typename GridImp::template Codim<0>::Geometry Geometry; typedef typename GridImp::template Codim<0>::LocalGeometry LocalGeometry; <<SNAP

the question is whether that's desirable and why gcc doesn't seem to care.

As a result of the above, gcc (4.4) will happily compile dune/grid/test/test-sgrid but clang will not.