[Bug c++/66602] New: std::tuple bug when constructed with temporary empty object
so61pi.re at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 19 17:09:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66602
Bug ID: 66602
Summary: std::tuple bug when constructed with temporary empty
object
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: so61pi.re at gmail dot com
Target Milestone: ---
-----
#include <iostream>
#include <tuple>
class empty_t {
};
int main() {
// should print 1, but doesn't
std::tuple<empty_t, int> a(empty_t{}, 1);
std::cout << std::get<1>(a) << "\n";
// works fine, prints 1
std::tuple<int, empty_t> b(1, empty_t{});
std::cout << std::get<0>(b) << "\n";
// works fine, prints 1
auto c = std::make_tuple(empty_t{}, 1);
std::cout << std::get<1>(c) << "\n";
}
-----
This code works fine when compiled with MSVC or clang.
More information about the Gcc-bugs
mailing list