This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8493: Bad interaction of strlen builtin and overload resolution
- From: bangerth at dealii dot org
- To: dagraz at radiance dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rutt at chezrutt dot com
- Date: 7 Nov 2002 23:15:15 -0000
- Subject: Re: c++/8493: Bad interaction of strlen builtin and overload resolution
- Reply-to: bangerth at dealii dot org, dagraz at radiance dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, rutt at chezrutt dot com, gcc-gnats at gcc dot gnu dot org
Old Synopsis: Outputing strlen() to ostream causes bogus compiler error
New Synopsis: Bad interaction of strlen builtin and overload resolution
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Nov 7 15:15:14 2002
State-Changed-Why:
Confirmed. This can be reduced to the following:
----------------------------------
typedef unsigned int size_t;
extern size_t strlen (__const char *__s) throw () __attribute__((__pure__));
static void foo(size_t);
static void foo(double);
main() {
foo(strlen("hello"));
}
----------------------------------
Which gives me with 3.2.1 and 3.3:
tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ -c y.ii
y.ii: In function `int main()':
y.ii:8: error: call of overloaded `foo(<anonymous>)' is ambiguous
y.ii:4: error: candidates are: void foo(unsigned int)
y.ii:5: error: void foo(double)
This used to work with 2.95, but does no more; I think the
time for marking regressions with "high" has passed, so
I leave it in the present "medium" state.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8493