[Bug libstdc++/55713] New: std::tuple<ElementType> incorrectly is convertible to "ElementType" when it is an empty class
schaub.johannes at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Sun Dec 16 16:46:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55713
Bug #: 55713
Summary: std::tuple<ElementType> incorrectly is convertible to
"ElementType" when it is an empty class
Classification: Unclassified
Product: gcc
Version: 4.7.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: schaub.johannes@googlemail.com
This code cannot be compiled with libstdc++
struct A {};
void f(A);
struct B { B(std::tuple<A>); };
void f(B);
int main() {
f(std::make_tuple(A()));
}
GCC shouts
"error: 'A' is an inaccessible base of 'tuple<A>'"
Libstdc++ should not make "std::tuple<EmptyClass>" derive from the empty class
directly.
More information about the Gcc-bugs
mailing list