This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80703] New: Including <utility> breaks structured bindings
- From: "barry.revzin at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 May 2017 14:21:00 +0000
- Subject: [Bug c++/80703] New: Including <utility> breaks structured bindings
- Auto-submitted: auto-generated
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.