This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Ambiguous overload for `std::ostream& << <anonymous>' operator
- From: Mark Goodman <mgoodman at CSUA dot Berkeley dot EDU>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Nov 2002 15:10:31 -0800 (PST)
- Subject: Ambiguous overload for `std::ostream& << <anonymous>' operator
The following code doesn't compile. I get the error message: test.cc:8:
error: ambiguous overload for `std::ostream& << <anonymous>' operator. I
tried compiling this on both the gcc 3.2 included in Red Hat 8 and gcc
built from CVS. It compiles if I substitute static_cast<size_t>(strlen("
")) for strlen(" ") which leads me to believe that this is a bug in gcc.
#include <iostream>
#include <string.h>
using namespace std;
int main(void) {
cout << strlen(" ");
return 0;
}