https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113470
Bug ID: 113470 Summary: Should std::tuple_size<const int> be a complete type? Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: de34 at live dot cn Target Milestone: --- The following code snippet is currently showing implementation divergence (https://godbolt.org/z/P8oWqf5sT). MSVC STL's std::tuple_size<const int> is a complete type, while libstdc++'s and libc++'s are not. ``` #include <tuple> // constexpr auto foo = sizeof(std::tuple_size<int>); // Correctly rejected. constexpr auto bar = sizeof(std::tuple_size<const int>); // Should be well-formed? ``` It seems that MSVC STL's behavior is justified by https://eel.is/c++draft/contents#1 and https://eel.is/c++draft/tuple.syn, given that only the primary templates of std::tuple_size and std::tuple_element are marked `// not defined`. I'm not sure whether this should be considered as a bug. Perhaps an LWG issue is wanted.