test-ug does not build with clang, due to Hybrid::ifElse weirdness
test-ug builds fine with gcc. However, if fails to build with both clang-3.6 and clang-3.8.
Here's how far I got: in uggridindexsets.hh:75 there is a code block
Hybrid::ifElse(Std::bool_constant<cc==0>(), [&](auto id)
{
[...]
result = UG_NS<dim>::levelIndex(UG_NS<dim>::GetEdge(UG_NS<dim>::Corner(grid_->getRealImplementation(e).getTarget(), // ***
UGGridRenumberer<dim>::verticesDUNEtoUG(a,e.type())),
UG_NS<dim>::Corner(grid_->getRealImplementation(e).getTarget(),
UGGridRenumberer<dim>::verticesDUNEtoUG(b,e.type()))));
}
});
The cc==0 condition is static, therefore this code should really only be instantiated when cc==0. However, clang barfs at the line *** when the case cc==1 is tested. I attach the error message below.
@carsten.graeser , as you wrote the Hybrid::ifElse, could you please have a look? Thanks!
In file included from /home/sander/dune/dune-grid/dune/grid/test/test-ug.cc:14:
In file included from /home/sander/dune/dune-grid/dune/grid/uggrid.hh:125:
/home/sander/dune/dune-grid/dune/grid/uggrid/uggridindexsets.hh:86:84: error: cannot initialize a parameter of
type 'const UG_NS<2>::Element *' (aka 'const UG::D2::element *') with an rvalue of type 'typename
UG_NS<2>::Entity<codim>::T *' (aka 'UG::D2::edge *')
...grid_->getRealImplementation(e).getTarget(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/sander/dune/dune-grid/dune/grid/common/indexidset.hh:178:31: note: in instantiation of function template
specialization 'Dune::UGGridLevelIndexSet<const Dune::UGGrid<2> >::subIndex<1>' requested here
return asImp().template subIndex< cc >( e, i, codim );
The error by itself is okay when cc==1, that is why a static if is used.