Skip to content

Remove templated get function from static_array_impl::get#459

Open
Quntized wants to merge 2 commits into
kokkos:stablefrom
Quntized:quntized-return
Open

Remove templated get function from static_array_impl::get#459
Quntized wants to merge 2 commits into
kokkos:stablefrom
Quntized:quntized-return

Conversation

@Quntized

@Quntized Quntized commented Jul 1, 2026

Copy link
Copy Markdown

While reviewing the mdspan. I noticed a missing return statement in the C++14 implementation of static_array_impl::get<r>() at include/experimental/__p0009_bits/extents.hpp .

Signed-off-by: Quntized <mdsajid-09-2021911491@ne.du.ac.bd>
@mhoemmen

mhoemmen commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix!

Could you please explain your interest in C++14 support? Do you have particular regulatory requirements to use C++14 or did you just happen to notice the bug? Also, did you use an automated tool to find this, and if so, what tool?

I'm asking because much of the value of mdspan comes from newer C++ versions. The submdspan feature (for array slices) requires at least C++17, for example.

@Quntized

Quntized commented Jul 1, 2026

Copy link
Copy Markdown
Author

Hi @mhoemmen, thanks for the reply!

I don't have any regulatory requirements for C++14, nor did I use any automated tools. I am just exploring the Kokkos codebase to better understand its architecture and template metaprogramming patterns. While manually reading and testing through the mdspan implementations, I spotted the missing return statement in the C++14 #else block.

Interestingly, when I tried to trigger the bug locally on my laptop by forcing CMAKE_CXX_STANDARD=14, it still bypassed the fallback path. I realized CMake was applying transitive compiler requirements-since my local Kokkos installation was built with C++20, causing MDSPAN_HAS_CXX_17 to evaluate to true. However, I knew a strict C++14 setup compiling from scratch would still hit the missing return.

I know the library is focused on modern C++ now, but I figured it was worth submitting the patch for anyone still locked into older environments.

If it's useful context , I maintain a personal repository where I systematically test and investigate Kokkos internals while exploring the codebase: https://github.com/Quntized/Kokkos_internal. The C++14 path in mdspan came up while doing similar manual exploration of the containers layer

@crtrott

crtrott commented Jul 1, 2026

Copy link
Copy Markdown
Member

Interesting out C++ tests here in mdspan must not exercise that guy. I think we can just merge it for now. We may wanna try and figure out why it's not getting exercised though.

@crtrott

crtrott commented Jul 1, 2026

Copy link
Copy Markdown
Member

I think the entire function is unused at this point and could just be deleted.

@crtrott crtrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets just remove the get function which is templated on the index value.

Signed-off-by: Quntized <mdsajid-09-2021911491@ne.du.ac.bd>
@Quntized Quntized requested a review from crtrott July 2, 2026 12:33
@Quntized Quntized changed the title Fix missing return in C++14 for static_array_impl::get Remove templated get function from static_array_impl::get Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants