Drop support for clang-3.5!
Currently dune-functions fails to compile with clang-3.5 as shipped e.g. with Debian Jessie (current stable) and Ubuntu 14.4 LTS. Digging into this I found that this is due to a bug in clang-3.5. The result of this bug is, that std::index_sequence_for<T...>
will in certain nested contexts have the wrong size. As a consequence our CompositeNodeFactory
fails to compile. There we could simply work around this issue by replacing std::index_sequence_for<T...>
by std::make_index_sequence<sizeof...(T)>
which works correctly. Both should yield the same result and in fact the implementation of std::index_sequence_for<T...>
does exactly this, i.e., this is a clang error with nested expansion of argument packs.
While the fix is simple, I'm really scared by this bug: std::integer_sequence
was introduced to simplify unpacking of std::tuple
and to do actions on each entry. If now, the sequence contains only 0
instead of 0,1
for a tuple of size 2, this may lead to correct code that silently leaves out the last entry. The attached example index_sequence_for_test.cc illustrates the incorrect size of the std::integer_sequence
. It also provides an idiomatic example of tuple unpacking where this bug leads to compiling code which silently yields wrong results. Since the bounds of such 'loops' are hard-wired into the type it will also be very hard to find such problems in actual application code.
To avoid severe problems I propose to explicitly not support clang-3.5. Notice that the new Hybrid::forEach()
in dune-common also uses tuple unpacking and may thus silently leave out entries of the container.