This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/80675] New: Incorrect implementation of LWG 2534
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 May 2017 17:13:00 +0000
- Subject: [Bug libstdc++/80675] New: Incorrect implementation of LWG 2534
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80675
Bug ID: 80675
Summary: Incorrect implementation of LWG 2534
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
#include <ostream>
struct X { };
std::ostream& operator<<(std::ostream& os, const X&) { return os; }
struct O : std::ostream { };
void operator<<(O&, X) = delete;
int main()
{
O{} << X{};
}
This should compile, because the operator<<(basic_ostream<C,Tr>&&, const T&)
overload should be chosen by overload resolution.
However we implement the "os << t is valid" constrain using the wrong type, as
we do it on the derived type, not after conversion to basic_ostream<C,Tr>.