https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82647

            Bug ID: 82647
           Summary: std::tuple_size_v is missing from <array> and
                    <utility>
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bitbug1985 at icloud dot com
  Target Milestone: ---

x.cpp:
#include <array>

int
main()
{
    std::array<int, 3> arr;
    auto size = std::tuple_size_v<decltype(arr)>;
}

% g++ --version
g++ (MacPorts gcc7 7.2.0_0) 7.2.0
% g++ -std=c++17 -o x x.cpp
x.cpp: In function 'int main()':
x.cpp:7:22: error: 'tuple_size_v' is not a member of 'std'
     auto size = std::tuple_size_v<decltype(arr)>;
                      ^~~~~~~~~~~~
x.cpp:7:22: note: suggested alternative: 'tuple_size'
     auto size = std::tuple_size_v<decltype(arr)>;
                      ^~~~~~~~~~~~
                      tuple_size
x.cpp:7:35: error: expected primary-expression before 'decltype'
     auto size = std::tuple_size_v<decltype(arr)>;
                                   ^~~~~~~~

I get the same error if I replace std::array with std::pair. If I additionally
include <tuple>, which should be unnecessary, this compiles. For what it's
worth, it compiles as-is in clang++.

Reply via email to