This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/80675] New: Incorrect implementation of LWG 2534


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>.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]