This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[3.0 regression] libstdc++ and strstr
- To: <gcc-bugs at gcc dot gnu dot org>, <libstdc++ at gcc dot gnu dot org>
- Subject: [3.0 regression] libstdc++ and strstr
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Date: Wed, 16 May 2001 09:33:33 +0200 (CEST)
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/