From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31645 invoked by alias); 5 Mar 2003 22:23:19 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 31621 invoked by uid 48); 5 Mar 2003 22:23:18 -0000 Date: Wed, 05 Mar 2003 22:23:00 -0000 Message-ID: <20030305222318.31620.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, tilps@hotmail.com From: bangerth@dealii.org Reply-To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, tilps@hotmail.com, gcc-gnats@gcc.gnu.org Subject: Re: c++/9809: [3.3/3.4 regression] when are builtins brought into view X-SW-Source: 2003-03/txt/msg00234.txt.bz2 List-Id: Old Synopsis: 3.4 regression(?) - spurious ambiguity of overloaded function New Synopsis: [3.3/3.4 regression] when are builtins brought into view State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Wed Mar 5 22:23:18 2003 State-Changed-Why: This is actually a serious regression: --------------------- namespace std { class Base {}; } struct Derived : public std::Base { operator const char*() const; operator bool(void) const; }; void log(const char* str); void nothing() { Derived temp; log(temp); } ---------------------- This doesn't compile with 3.3 and 3.4: g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c y.cc y.cc: In function `void nothing()': y.cc:15: error: call of overloaded `log(Derived&)' is ambiguous y.cc:10: error: candidates are: void log(const char*) :15: error: double std::log(double) There's only one log() function in the file, so there shouldn't be a problem. Now, it _does_ compile if we rename the namespace away from std, or name the function something else than log(), so it looks like if the math functions are brought into global namespace if namespace std is involved. That's wrong here. W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9809