[dune-pdelab] dune-pdelab-howto: two-phase example no longer build with gcc-4.6.1

Ansgar Burchardt ansgar.burchardt at iwr.uni-heidelberg.de
Mon Nov 28 12:53:44 CET 2011


Am 25.11.2011 16:07, schrieb Christian Engwer:
> On Thu, Nov 24, 2011 at 04:14:59PM +0100, Ansgar Burchardt wrote:
>> the two-phase example no longer builds with gcc 4.6.1 (Ubuntu 11.10):
>>
>> dnaplmfd.cc:62:26: error: 'constexpr' needed for in-class
>> initialization of static data member 'const double TwoPhaseParameter<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
>> Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>  >,
>> double>::eps1' of non-integral type
>>
>> It works when using "constexpr" instead of "const" in the referenced
>> line and the line below.
>
> but constexpr isn't backward compatible.
>
> We should move the initialization out of the class body.

That works with gcc 4.6.1 (Ubuntu 11.10) and gcc 4.4.5 (Debian 6).

I have attached the patch I used.

Regards,
Ansgar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Move-static-const-initialization-out-of-the-class-bo.patch
Type: text/x-patch
Size: 2434 bytes
Desc: not available
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20111128/b9db770f/attachment.bin>


More information about the dune-pdelab mailing list