From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B7CCC3858C1F; Thu, 10 Feb 2022 09:41:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7CCC3858C1F From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/89855] Inconsistent global namespace overload sets from #include Date: Thu, 10 Feb 2022 09:41:21 +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: 9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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: Thu, 10 Feb 2022 09:41:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D89855 --- Comment #10 from Jonathan Wakely --- Ville brought a related case to my attention. With Glibc this compiles, and finds libc's ::sqrt(double) #include int i =3D sqrt(0); But on Solaris it doesn't even compile. Solaris libc provides all three of sqrt(float), sqrt(double), sqrt(long double), which makes this ambiguous. The additional overload that works for integral types is not provided by Solaris libc's , only by , and so can't be found here because there is no 'using std::sqrt;' to put it into the global namespace. So this compiles and even gives the expected result (returning a double) on linux, but fails to compile on Solaris. This suggests that we even need the additional overloads for integral argum= ents to be unconditionally dumped into both the global namespace and std.=