This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9809: [3.3/3.4 regression] when are builtins brought into view
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, tilps at hotmail dot com
- Date: 5 Mar 2003 22:23:18 -0000
- Subject: Re: c++/9809: [3.3/3.4 regression] when are builtins brought into view
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, tilps at hotmail dot com, gcc-gnats at gcc dot gnu dot org
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*)
<internal>: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