This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]