return values not recognized as constexpr
On my laptop with gcc version 7.3.1 20180323 [gcc-7-branch revision 258812] (SUSE Linux) compiling gives errors such as
/home/bernd/DUMUX/dumux/dumux/geomechanics/poroelastic/volumevariables.hh:79:29: error: no matching function for call to ‘Dumux::PoroElasticVolumeVariables<Dumux::ElasticVolumeVariablesTraits<Dune::FieldVector<double, 2>, Dune::FieldVector<double, 2>, Dumux::PoroElasticModelTraits<2, 1, 1, 1>, Dumux::InertSolidState<double, Dumux::SolidSystems::InertSolidPhase<double, Dumux::Components::Constant<1, double> > >, Dumux::SolidSystems::InertSolidPhase<double, Dumux::Components::Constant<1, double> > > >::setSolidTemperature_(const Dumux::PoroElasticProblem<Dumux::Properties::TTag::PoroElasticTypeTag>&, const Dumux::BoxElementSolution<Dumux::BoxFVElementGeometry<Dumux::BoxFVGridGeometry<double, Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2> > >, false, Dumux::BoxDefaultGridGeometryTraits<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2> > >, Dumux::DefaultMapperTraits<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2> > >, Dune::MultipleCodimMultipleGeomTypeMapper<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2> > >, Dune::Impl::MCMGFailLayout>, Dune::MultipleCodimMultipleGeomTypeMapper<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<2> > >, Dune::Impl::MCMGFailLayout> > > >, false>, Dune::FieldVector<double, 2> >&)’
setSolidTemperature_(problem, elemSol);
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /home/bernd/DUMUX/dumux/dumux/geomechanics/poroelastic/model.hh:39:0,
from /home/bernd/DUMUX/dumux/test/geomechanics/poroelastic/problem.hh:30,
from /home/bernd/DUMUX/dumux/test/geomechanics/poroelastic/test_poroelastic.cc:35:
/home/bernd/DUMUX/dumux/dumux/geomechanics/poroelastic/volumevariables.hh:144:10: note: candidate: template<class Problem, class ElemSol, bool EB, typename std::enable_if<EB, int>::type <anonymous> > void Dumux::PoroElasticVolumeVariables<Traits>::setSolidTemperature_(const Problem&, const ElemSol&) [with Problem = Problem; ElemSol = ElemSol; bool EB = EB; typename std::enable_if<EB, int>::type <anonymous> = <enumerator>; Traits = Dumux::ElasticVolumeVariablesTraits<Dune::FieldVector<double, 2>, Dune::FieldVector<double, 2>, Dumux::PoroElasticModelTraits<2, 1, 1, 1>, Dumux::InertSolidState<double, Dumux::SolidSystems::InertSolidPhase<double, Dumux::Components::Constant<1, double> > >, Dumux::SolidSystems::InertSolidPhase<double, Dumux::Components::Constant<1, double> > >]
void setSolidTemperature_(const Problem& problem, const ElemSol& elemSol)
^~~~~~~~~~~~~~~~~~~~
/home/bernd/DUMUX/dumux/dumux/geomechanics/poroelastic/volumevariables.hh:144:10: note: template argument deduction/substitution failed:
/home/bernd/DUMUX/dumux/dumux/geomechanics/poroelastic/volumevariables.hh:143:58: error: expression ‘Dumux::PoroElasticModelTraits<2, 1, 1, 1>::enableEnergyBalance’ is not a constant expression
bool EB = ModelTraits::enableEnergyBalance(), std::enable_if_t<EB, int> = 0 >
^
/home/bernd/DUMUX/dumux/dumux/geomechanics/poroelastic/volumevariables.hh:143:58: note: in template argument for type ‘bool’
although the function is defined as static constexpr bool enableEnergyBalance()
.
Edited by Bernd Flemisch