This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81888] New: Structured bindings stopped working
- From: "antoshkka at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Aug 2017 13:09:34 +0000
- Subject: [Bug c++/81888] New: Structured bindings stopped working
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81888
Bug ID: 81888
Summary: Structured bindings stopped working
Product: gcc
Version: 7.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: antoshkka at gmail dot com
Target Milestone: ---
The following code worked well on GCC-7.1, but fails on GCC-7.2 with
-std=c++17:
struct do_not_define_std_tuple_size_for_me {
bool test1 = true;
};
template <class T>
bool is_structured_bindings_work() noexcept {
auto [a] = T{};
return a;
}
const bool do_not_use =
is_structured_bindings_work<do_not_define_std_tuple_size_for_me>();
Error message:
error: invalid initializer for structured binding declaration
auto [a] = T{};
^~~
Fix from Bug 78939 does not resolves the issue. Clang-4.0 and GCC-7.1 compile
the code well.