New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::tuple_size should be a struct #39218
Comments
assigned to @mclow |
Further research revealed this might've changed recently? The C++14 draft I have access to (N3936, Page 491) lists them as Since the only ABI difference will be on MSVC, and MSVC is using |
[ Short answer, it's not libc++, it's the standard ] In [utility.syn], we've got (this is all post-2017): // 19.4.4, tuple-like access to pair In [pair.astuple]: In [tuple.syn] template<class... Types> class tuple_size<tuple<Types...>>; and in [tuple.helper]: template struct tuple_size; In [array.syn]: template<class T, size_t N> in [array.tuple]: I'll have to clean this up in the standard. |
Ouch, alright, that's unfortunate. |
It appears that libc++ is consistent; it uses 'class' everywhere. |
The standard isn't going to change; see cplusplus/draft#534 Committed revision 350972 to make |
As of r348233, Clang ignores declarations in system headers when deciding whether to issue -Wmismatched-tags, which should cover this more generally (but only for new versions of Clang, of course). |
Extended Description
Currently
std::tuple_size
is declared asclass tuple_size
. According to the C++ standard,tuple_size
is astruct
(http://eel.is/c++draft/tuple.helper#lib:tuple_size).This creates portability problems between libcxx and libstdc++, which correctly declares it as a
struct
. Currently using either will result in-Wmismatched-tags
.The text was updated successfully, but these errors were encountered: