This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66693] New: [C++17] std::tuple_size fails with const std::array
- From: "ldionne.2 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 28 Jun 2015 11:10:25 +0000
- Subject: [Bug c++/66693] New: [C++17] std::tuple_size fails with const std::array
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66693
Bug ID: 66693
Summary: [C++17] std::tuple_size fails with const std::array
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ldionne.2 at gmail dot com
Target Milestone: ---
The following code fails on GCC trunk:
------------------------------------------------------------------------------
#include <array>
int main() {
std::tuple_size<std::array<int, 10> const>::value;
}
------------------------------------------------------------------------------
The failure is
error: implicit instantiation of undefined template
'std::tuple_size<const std::array<int, 10> >'
std::tuple_size<std::array<int, 10> const>::value;
^
note: template is declared here
class tuple_size;
^
This is because the specializations of tuple_size for const and volatile
types is in the <tuple> header, but they ought to be available when including
<utility> and <array> in C++17.
Strictly speaking, this isn't a bug since C++14 does not require <utility> and
<array> to have these specializations AFAIK. However, it would be a trivial
fix.