From mboxrd@z Thu Jan 1 00:00:00 1970 From: dmuell@gmx.net To: gcc-gnats@gcc.gnu.org Subject: libstdc++/2989: libstdc++ breaks compilation of strcpy Date: Tue, 29 May 2001 05:56:00 -0000 Message-id: <200105291249.f4TCndW26197@rotes20.wohnheim.uni-kl.de> X-SW-Source: 2001-05/msg00997.html List-Id: >Number: 2989 >Category: libstdc++ >Synopsis: ambiguous overload of strcpy when including iostream >Confidential: no >Severity: critical >Priority: high >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Tue May 29 05:56:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Dirk A. Mueller >Release: 3.0 20010529 (prerelease) >Organization: >Environment: System: Linux 2.4.4 Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../configure --enable-languages=c,c++ --enable-shared --enable-threads --enable-c99 --enable-long-long >Description: this code does no longer compile: === Cut === #include #include using namespace std; int main() { char foo[300]; char* bar = "foo"; strcpy(foo, bar); } === Cut === the error message is: call of overloaded `strcpy(char[300], char*&)' is ambiguous /usr/include/string.h:78: candidates are: char* strcpy(char*, const char*) /usr/local/include/g++-v3/bits/std_cstring.h:104: char* std::strcpy(char*, const char*) it worked fine with the gcc of a few days ago and with gcc 2.95.3 as all previous releases (of course, as they didn't handle namespace conflicts) >How-To-Repeat: >Fix: none known except removing the "using namespace" directive. >Release-Note: >Audit-Trail: >Unformatted: