Skip to content

Commit 5411bc9

Browse files
committed
Work around array-bounds false positive in GCC 14
1 parent 560d252 commit 5411bc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/fplus/container_common.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ Container intersperse(const X& value, const Container& xs)
16381638
if (xs.empty())
16391639
return Container();
16401640
if (size_of_cont(xs) == 1)
1641-
return xs;
1641+
return Container({xs.front()}); // workaround for array-bounds false positive in GCC 14
16421642
Container result;
16431643
internal::prepare_container(result, std::max<std::size_t>(0, size_of_cont(xs) * 2 - 1));
16441644
auto it = internal::get_back_inserter(result);

0 commit comments

Comments
 (0)