[3.0 regression] libstdc++ and strstr
Gerald Pfeifer
pfeifer@dbai.tuwien.ac.at
Wed May 16 00:33:00 GMT 2001
The following most trivial code snippet fails to compile with current
CVS sources on the GCC 3.0 branch on i686-pc-linux-gnu:
#include <string>
using namespace std;
char *f() {
strstr("aba","b");
}
This is the failure mode:
% gccvs x.cc
x.cc: In function `char *f()':
x.cc:6: call of overloaded `strstr(const char[4], const char[2])' is ambiguous
/usr/include/string.h:178: candidates are: char* strstr(const char*, const char*)
/sw/gcc/include/g++-v3/bits/std_cstring.h:125:
char* std::strstr(char*, const char*)
/sw/gcc/include/g++-v3/bits/std_cstring.h:121:
const char* std::strstr(const char*, const char*)
(The return of f() does not matter; either void, char*, or const char*
result in the same error.)
Gerald
PS: I'll take care of filing a formal GNATS PR, unless we can address this
today or tomorrow...
--
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/
More information about the Libstdc++
mailing list