clang compiler error: unmatched template parameter `const CenteringEnum*`
Summary
Clang compiler errors for ippl unit test BCond.
Steps to reproduce
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/local/bin/mpicc-mpich-clang90
Relevant logs and/or screenshots
[ 97%] Building CXX object tests/CMakeFiles/opal_unit_tests.dir/ippl_src/Field/BCond.cpp.o
In file included from /Users/jsnuverink/Documents/OPAL/fork/src/tests/ippl_src/Field/BCond.cpp:7:
In file included from /Users/jsnuverink/Documents/OPAL/fork/src/ippl/src/FieldLayout/CenteredFieldLayout.h:127:
/Users/jsnuverink/Documents/OPAL/fork/src/ippl/src/FieldLayout/CenteredFieldLayout.hpp:313:3: error: no matching
function for call to 'centeredInitialize'
centeredInitialize(*this, mesh, p, vnodes);
^~~~~~~~~~~~~~~~~~
/Users/jsnuverink/Documents/OPAL/fork/src/tests/ippl_src/Field/BCond.cpp:411:38: note: in instantiation of member
function 'CenteredFieldLayout<2, UniformCartesian<2, double>, CartesianCentering<&CCCEnums<2, 2,
0>::vectorFace, 2, 2> >::CenteredFieldLayout' requested here
CenteredFieldLayout<Dim,M,vFace> layoutVFace(mesh);
^
/Users/jsnuverink/Documents/OPAL/fork/src/ippl/src/FieldLayout/CenteredFieldLayout.hpp:93:1: note: candidate
template ignored: substitution failure : deduced non-type template argument does not have the same type as
the corresponding template parameter ('CenteringEnum *' vs 'const CenteringEnum *')
centeredInitialize(CenteredFieldLayout<Dim,Mesh,
^
...
Possible fixes
The template parameter CenteringEnum* always has a const qualifier, for example, https://gitlab.psi.ch/OPAL/src/blob/master/ippl/src/Meshes/CartesianCentering.h#L35:
template<const CenteringEnum* CE, unsigned Dim, unsigned NComponents=1U>
class CartesianCentering
{
However the const qualifier seems too restrictive and I propose to remove it.