From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7E0AE3858024; Sun, 21 Mar 2021 05:26:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E0AE3858024 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/99692] Lookup for operator<< skips global scope Date: Sun, 21 Mar 2021 05:26:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2021 05:26:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99692 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |libstdc++ --- Comment #1 from Andrew Pinski --- Right the problem is here (and not with the compiler itself if there is a problem): /home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:747:46: error: no match for =E2=80=98operator<<=E2=80=99 (operand types are =E2=80=98std::basic_ost= ream=E2=80=99 and =E2=80=98const std::vector=E2=80=99) 746 | __void_t() | ~~~~~~~~~~~~~~~~~~~~ 747 | << declval())>> | ^~~~~~~~~~~~~~~~~~~~~~= ~~ But by definition at this point operator << does not exist and is not considered as it is not found via ADL because both std::basic_ostream= and std::vector are in the std namespace and the global namespace is not considered. /home/ubuntu/upstream-gcc/include/c++/11.0.1/ostream:773:5: required by substitution of =E2=80=98template typename std::enable_if >, std::__is_convertible_to_basic_ostream<_Ostream>, std::__is_insertable::__ostream_type, const _Tp&, vo= id> >::value, typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type std::operator<<(_Ostream&&, const _Tp&) [with _Ostream =3D CustomStream; _T= p =3D std::vector]=E2=80=99 t78.cc:21:41: required from here template inline typename enable_if<__and_<__not_>, __is_convertible_to_basic_ostream<_Ostream>, __is_insertable< __rvalue_ostream_type<_Ostream>, const _Tp&>>::value, __rvalue_ostream_type<_Ostream>>::type operator<<(_Ostream&& __os, const _Tp& __x) It is the __is_insertable in the above. So it might be the wrong type being used to check __is_insertable ....=