This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/80703] New: Including <utility> breaks structured bindings


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

            Bug ID: 80703
           Summary: Including <utility> breaks structured bindings
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

>From this StackOverflow question: http://stackoverflow.com/q/43894619/2069064

This example fails:

#include <utility>

struct Point { int x, y; };

int main()
{
    const auto [x, y] = Point{};
}

with:

bug.cpp: In function 'int main()':
bug.cpp:7:16: error: 'std::tuple_size<const Point>::value' is not an integral
constant expression
     const auto [x, y] = Point{};
                ^~~~~~

but removing the #include <utility> causes it to compile.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]