Skip to content

Commit

Permalink
Fix errors reported by gcc-8.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
KineticTheory authored and D. S. Hollman committed Apr 24, 2020
1 parent c80a398 commit f8cbc89
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
18 changes: 13 additions & 5 deletions include/experimental/__p0009_bits/layout_stride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,27 @@ class layout_stride_impl<

// TODO @proposal-bug @proposal-extension layout stride needs this constructor
// clang-format off
#if defined(__INTEL_COMPILER)
// Work-around for an ICE. layout_stride won't properly SFINAE with ICC, but oh well
MDSPAN_FUNCTION_REQUIRES(
(MDSPAN_INLINE_FUNCTION constexpr explicit),
layout_stride_impl, (std::experimental::extents<Exts...> const& e), noexcept,
/* requires */ (
// remember that this also covers the zero strides case because an && fold on an empty pack is true
#if defined(__INTEL_COMPILER)
// Work-around for an ICE. layout_stride won't properly SFINAE with ICC, but oh well
true
)
)
#else
MDSPAN_FUNCTION_REQUIRES(
(MDSPAN_INLINE_FUNCTION constexpr explicit),
layout_stride_impl, (std::experimental::extents<Exts...> const& e), noexcept,
/* requires */ (
// remember that this also covers the zero strides case because an && fold on an empty pack is true
_MDSPAN_FOLD_AND(Strides != dynamic_extent /* && ... */)
#endif
)
) : __base_t(__base_t{__member_pair_t(e, __strides_storage_t())})
)
#endif
: __base_t(__base_t{__member_pair_t(e, __strides_storage_t())})
{ }
// clang-format on

Expand Down Expand Up @@ -323,4 +331,4 @@ struct layout_stride {
};

} // end namespace experimental
} // end namespace std
} // end namespace std
3 changes: 1 addition & 2 deletions include/experimental/__p0009_bits/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
//==============================================================================
// <editor-fold desc="inline variables"> {{{1

#if _MDSPAN_USE_INLINE_VARIABLES
#ifdef _MDSPAN_USE_INLINE_VARIABLES
# define _MDSPAN_INLINE_VARIABLE inline
#else
# define _MDSPAN_INLINE_VARIABLE
Expand Down Expand Up @@ -610,4 +610,3 @@ struct __bools;

// </editor-fold> end Pre-C++14 constexpr }}}1
//==============================================================================

8 changes: 5 additions & 3 deletions include/experimental/__p0009_bits/subspan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct preserve_layout_right_analysis : integral_constant<bool, result> {
// nothing else changes (though if they're true, it doesn't matter)
encountered_first_all,
encountered_first_pair
>;
>;
};

template <
Expand All @@ -137,7 +137,7 @@ template <
struct preserve_layout_left_analysis : integral_constant<bool, result> {
using layout_type_if_preserved = layout_left;
using encounter_pair = preserve_layout_left_analysis<
// Only the left-most slice can be a pair. If we've encountered anything else,
// Only the left-most slice can be a pair. If we've encountered anything else,
// we can't preserve any contiguous layout
(encountered_first_scalar || encountered_first_all || encountered_first_pair) ? false : result,
// These change in the expected ways
Expand Down Expand Up @@ -228,6 +228,7 @@ struct __assign_op_slice_handler<
__extents_storage_t __exts;
__strides_storage_t __strides;

#ifdef __INTEL_COMPILER
#if __INTEL_COMPILER <= 1800
MDSPAN_INLINE_FUNCTION constexpr __assign_op_slice_handler(__assign_op_slice_handler&& __other) noexcept
: __offsets(::std::move(__other.__offsets)), __exts(::std::move(__other.__exts)), __strides(::std::move(__other.__strides))
Expand All @@ -240,6 +241,7 @@ struct __assign_op_slice_handler<
: __offsets(::std::move(__o)), __exts(::std::move(__e)), __strides(::std::move(__s))
{ }
#endif
#endif

// Don't define this unless we need it; they have a cost to compile
#ifndef _MDSPAN_USE_RETURN_TYPE_DEDUCTION
Expand Down Expand Up @@ -495,4 +497,4 @@ _MDSPAN_DEDUCE_RETURN_TYPE_SINGLE_LINE(
/* clang-format: on */

} // end namespace experimental
} // namespace std
} // namespace std

0 comments on commit f8cbc89

Please sign in to comment.