From: Benjamin Kosnik Date: Fri, 6 Apr 2001 22:05:10 +0000 (+0000) Subject: 15071.C (main): Update to conformant headers and constructs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a5434cb77933099c87b31153e543bf55cee6298b;p=gcc.git 15071.C (main): Update to conformant headers and constructs. 2001-04-06 Benjamin Kosnik * g++.old-deja/g++.benjamin/15071.C (main): Update to conformant headers and constructs. * g++.old-deja/g++.robertl/eb79.C: Same. * g++.old-deja/g++.robertl/eb77.C (main): Same. * g++.old-deja/g++.robertl/eb73.C: Same. * g++.old-deja/g++.robertl/eb66.C (main): Same. * g++.old-deja/g++.robertl/eb55.C (t): Same. * g++.old-deja/g++.robertl/eb54.C (main): Same. * g++.old-deja/g++.robertl/eb46.C (main): Same. * g++.old-deja/g++.robertl/eb44.C: Same. * g++.old-deja/g++.robertl/eb41.C (main): Same. * g++.old-deja/g++.robertl/eb4.C (main): Same. * g++.old-deja/g++.robertl/eb39.C: Same. * g++.old-deja/g++.robertl/eb33.C (main): Same. * g++.old-deja/g++.robertl/eb31.C (main): Same. * g++.old-deja/g++.robertl/eb30.C: Same. * g++.old-deja/g++.robertl/eb3.C: Same. * g++.old-deja/g++.robertl/eb24.C (T>): Same. * g++.old-deja/g++.robertl/eb21.C: Same. * g++.old-deja/g++.robertl/eb15.C: Same. * g++.old-deja/g++.robertl/eb118.C: Same. * g++.old-deja/g++.robertl/eb115.C (main): Same. * g++.old-deja/g++.robertl/eb113.C (streambuf): Same. * g++.old-deja/g++.robertl/eb109.C: Same. * g++.old-deja/g++.other/sibcall1.C (main): Same. * g++.old-deja/g++.mike/rtti1.C: Same. * g++.old-deja/g++.mike/p658.C: Same. * g++.old-deja/g++.mike/net46.C: Same. * g++.old-deja/g++.mike/net34.C: Same. * g++.old-deja/g++.mike/memoize1.C: Same. * g++.old-deja/g++.mike/eh2.C: Same. * g++.old-deja/g++.law/weak.C: Same. * g++.old-deja/g++.law/visibility7.C: Same. * g++.old-deja/g++.law/visibility25.C: Same. * g++.old-deja/g++.law/visibility22.C: Same. * g++.old-deja/g++.law/visibility2.C: Same. * g++.old-deja/g++.law/visibility17.C: Same. * g++.old-deja/g++.law/visibility13.C: Same. * g++.old-deja/g++.law/visibility10.C: Same. * g++.old-deja/g++.law/visibility1.C: Same. * g++.old-deja/g++.law/virtual3.C (eval): Same. * g++.old-deja/g++.law/vbase1.C: Same. * g++.old-deja/g++.law/operators32.C: Same. * g++.old-deja/g++.law/nest3.C: Same. * g++.old-deja/g++.law/missed-error2.C (foo): Same. * g++.old-deja/g++.law/except5.C (main): Same. * g++.old-deja/g++.law/cvt7.C (run): Same. * g++.old-deja/g++.law/cvt2.C: Same. * g++.old-deja/g++.law/cvt16.C: Same. * g++.old-deja/g++.law/ctors6.C (bar): Same. * g++.old-deja/g++.law/ctors17.C (main): Same. * g++.old-deja/g++.law/ctors13.C: Same. * g++.old-deja/g++.law/ctors12.C (main): Same. * g++.old-deja/g++.law/ctors10.C: Same. * g++.old-deja/g++.law/code-gen5.C: Same. * g++.old-deja/g++.law/bad-error7.C: Same. * g++.old-deja/g++.law/arm9.C: Same. * g++.old-deja/g++.law/arm12.C: Same. * g++.old-deja/g++.law/arg8.C: Same. * g++.old-deja/g++.law/arg1.C: Same. * g++.old-deja/g++.jason/typeid1.C (struct foo): Same. * g++.old-deja/g++.jason/template31.C: Same. * g++.old-deja/g++.jason/template24.C (main): Same. * g++.old-deja/g++.jason/2371.C: Same. * g++.old-deja/g++.eh/new2.C: Same. * g++.old-deja/g++.eh/new1.C: Same. * g++.old-deja/g++.brendan/ptolemy2.C: Same. * g++.old-deja/g++.brendan/nest21.C (main): Same. * g++.old-deja/g++.brendan/err-msg3.C: Same. * g++.old-deja/g++.brendan/crash62.C: Same. * g++.old-deja/g++.brendan/crash52.C: Same. * g++.old-deja/g++.brendan/crash49.C (main): Same. * g++.old-deja/g++.brendan/crash38.C: Same. * g++.old-deja/g++.brendan/crash15.C (main): Same. * g++.old-deja/g++.brendan/copy9.C: Same. From-SVN: r41167 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 915ba678f1d..9d8f5922533 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,81 @@ +2001-04-06 Benjamin Kosnik + + * g++.old-deja/g++.benjamin/15071.C (main): Update to conformant + headers and constructs. + * g++.old-deja/g++.robertl/eb79.C: Same. + * g++.old-deja/g++.robertl/eb77.C (main): Same. + * g++.old-deja/g++.robertl/eb73.C: Same. + * g++.old-deja/g++.robertl/eb66.C (main): Same. + * g++.old-deja/g++.robertl/eb55.C (t): Same. + * g++.old-deja/g++.robertl/eb54.C (main): Same. + * g++.old-deja/g++.robertl/eb46.C (main): Same. + * g++.old-deja/g++.robertl/eb44.C: Same. + * g++.old-deja/g++.robertl/eb41.C (main): Same. + * g++.old-deja/g++.robertl/eb4.C (main): Same. + * g++.old-deja/g++.robertl/eb39.C: Same. + * g++.old-deja/g++.robertl/eb33.C (main): Same. + * g++.old-deja/g++.robertl/eb31.C (main): Same. + * g++.old-deja/g++.robertl/eb30.C: Same. + * g++.old-deja/g++.robertl/eb3.C: Same. + * g++.old-deja/g++.robertl/eb24.C (T>): Same. + * g++.old-deja/g++.robertl/eb21.C: Same. + * g++.old-deja/g++.robertl/eb15.C: Same. + * g++.old-deja/g++.robertl/eb118.C: Same. + * g++.old-deja/g++.robertl/eb115.C (main): Same. + * g++.old-deja/g++.robertl/eb113.C (streambuf): Same. + * g++.old-deja/g++.robertl/eb109.C: Same. + * g++.old-deja/g++.other/sibcall1.C (main): Same. + * g++.old-deja/g++.mike/rtti1.C: Same. + * g++.old-deja/g++.mike/p658.C: Same. + * g++.old-deja/g++.mike/net46.C: Same. + * g++.old-deja/g++.mike/net34.C: Same. + * g++.old-deja/g++.mike/memoize1.C: Same. + * g++.old-deja/g++.mike/eh2.C: Same. + * g++.old-deja/g++.law/weak.C: Same. + * g++.old-deja/g++.law/visibility7.C: Same. + * g++.old-deja/g++.law/visibility25.C: Same. + * g++.old-deja/g++.law/visibility22.C: Same. + * g++.old-deja/g++.law/visibility2.C: Same. + * g++.old-deja/g++.law/visibility17.C: Same. + * g++.old-deja/g++.law/visibility13.C: Same. + * g++.old-deja/g++.law/visibility10.C: Same. + * g++.old-deja/g++.law/visibility1.C: Same. + * g++.old-deja/g++.law/virtual3.C (eval): Same. + * g++.old-deja/g++.law/vbase1.C: Same. + * g++.old-deja/g++.law/operators32.C: Same. + * g++.old-deja/g++.law/nest3.C: Same. + * g++.old-deja/g++.law/missed-error2.C (foo): Same. + * g++.old-deja/g++.law/except5.C (main): Same. + * g++.old-deja/g++.law/cvt7.C (run): Same. + * g++.old-deja/g++.law/cvt2.C: Same. + * g++.old-deja/g++.law/cvt16.C: Same. + * g++.old-deja/g++.law/ctors6.C (bar): Same. + * g++.old-deja/g++.law/ctors17.C (main): Same. + * g++.old-deja/g++.law/ctors13.C: Same. + * g++.old-deja/g++.law/ctors12.C (main): Same. + * g++.old-deja/g++.law/ctors10.C: Same. + * g++.old-deja/g++.law/code-gen5.C: Same. + * g++.old-deja/g++.law/bad-error7.C: Same. + * g++.old-deja/g++.law/arm9.C: Same. + * g++.old-deja/g++.law/arm12.C: Same. + * g++.old-deja/g++.law/arg8.C: Same. + * g++.old-deja/g++.law/arg1.C: Same. + * g++.old-deja/g++.jason/typeid1.C (struct foo): Same. + * g++.old-deja/g++.jason/template31.C: Same. + * g++.old-deja/g++.jason/template24.C (main): Same. + * g++.old-deja/g++.jason/2371.C: Same. + * g++.old-deja/g++.eh/new2.C: Same. + * g++.old-deja/g++.eh/new1.C: Same. + * g++.old-deja/g++.brendan/ptolemy2.C: Same. + * g++.old-deja/g++.brendan/nest21.C (main): Same. + * g++.old-deja/g++.brendan/err-msg3.C: Same. + * g++.old-deja/g++.brendan/crash62.C: Same. + * g++.old-deja/g++.brendan/crash52.C: Same. + * g++.old-deja/g++.brendan/crash49.C (main): Same. + * g++.old-deja/g++.brendan/crash38.C: Same. + * g++.old-deja/g++.brendan/crash15.C (main): Same. + * g++.old-deja/g++.brendan/copy9.C: Same. + Fri Apr 6 15:36:15 2001 J"orn Rennecke * gcc.c-torture/execute/20001203-2.c (main): diff --git a/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C b/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C index d05ba8c00dd..eaa8eeebd10 100644 --- a/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C +++ b/gcc/testsuite/g++.old-deja/g++.benjamin/15071.C @@ -2,10 +2,10 @@ // g++/15071 // gcc invocation fails to link in libstdc++ -#include +#include int main() { - cout<<"hi"< +#include // token types: from state parser const int T_EOF = 257; @@ -35,10 +35,11 @@ main () { ParseToken b(a); if (b.doubleval == 23.2) - cout << "PASS\n"; + std::cout << "PASS\n"; else { - cout << "FAIL\n"; + std::cout << "FAIL\n"; return 1; } } + diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C index 56a7e75b9ba..953144ac5ac 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash15.C @@ -1,22 +1,22 @@ // Build don't link: // GROUPS passed old-abort -#include +#include class A { public: - virtual ~A() {cout << "executed ~A()\n";}; + virtual ~A() {std::cout << "executed ~A()\n";}; }; class B : public A { public: - virtual ~B() {cout << "executed ~B()\n";}; + virtual ~B() {std::cout << "executed ~B()\n";}; }; int main() { - cout << "starting\n"; + std::cout << "starting\n"; B b; b.~A();// ERROR - destructor - cout << "done\n"; + std::cout << "done\n"; }; diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C index eeb70e1c373..5f0cf9bd2c2 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash38.C @@ -8,7 +8,7 @@ main.cc: Please report this to 'bug-g++@prep.ai.mit.edu' */ -#include +#include class INTEGER { int x; @@ -16,7 +16,7 @@ public: typedef int BASE; INTEGER(int y) : x(y) {} INTEGER() {} - void encode() { cout << "Integer encoder";} + void encode() { std::cout << "Integer encoder";} int operator=(int y) { x=y; return x; } operator int() {return x; } }; diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C index 98a580d3cb1..3f2e2256e35 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash49.C @@ -1,12 +1,12 @@ // Build don't link: // GROUPS passed old-abort -#include +#include const int keys = 10; const int key[keys] = {6, key[1], 2, keys, 1, 7, 6, key[2], key[8]}; void main() { // ERROR - return type for main - for(int i = 0; i < keys;) cout << key[i++] << " "; - endl(cout); + for(int i = 0; i < keys;) std::cout << key[i++] << " "; + std::endl(std::cout); } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C index b4daa9de702..e8c51e8be2f 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C @@ -1,7 +1,7 @@ // Build don't link: // GROUPS passed old-abort // Special g++ Options: -Wreturn-type -#include +#include class A { public: @@ -9,6 +9,6 @@ public: }; A &f(A &a) {// ERROR - new decl.* - cout << "Blah\n"; + std::cout << "Blah\n"; } // ERROR - non-void function diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C index 77b9fc84763..c86f9e6bb4a 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash62.C @@ -1,11 +1,11 @@ // Build don't link: // GROUPS passed old-abort -#include +#include void - fubar(ostream* out, const char* string) + fubar(std::ostream* out, const char* s) { - (*out) << string << endl; + (*out) << s << std::endl; return; } @@ -14,8 +14,8 @@ { // Declare a ref and a pointer to the same ostream. // - ostream* out = &cerr; - ostream& die = cerr; + std::ostream* out = &std::cerr; + std::ostream& die = std::cerr; // Valid call to fubar. // diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C b/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C index 57f3b426108..4574a367254 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/cvt1.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed conversions -#include +#include class Thing { @@ -39,6 +39,6 @@ main (int argc, char** argv) Group g (Group::THIS_GROUP) ; g += new Thing (Thing::GOOD_THING) ; - cout << "Group type is " << (Group::GroupType) g << endl ; + std::cout << "Group type is " << (Group::GroupType) g << std::endl ; return 0 ; } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C b/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C index 1d115e6c46a..76a084090ae 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/err-msg3.C @@ -1,7 +1,7 @@ // Build don't link: // GROUPS passed error-messages -#include -#include +#include +#include // This error should not appear: // bug.C: In method `test::test(const class test &)': diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C b/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C index cce10c44cbd..03d3f32ad74 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/nest21.C @@ -1,7 +1,7 @@ // GROUPS passed nested-classes -#include -#include -#include +#include +#include +#include static char output[1024]; @@ -32,44 +32,44 @@ public: BDDRetrace::Dump& BDDRetrace::Dump1::operator<<(char c) { char tempout[1024]; - sprintf (tempout, "%s%s%c", output, "1-", c); - strcpy (output, tempout); + std::sprintf(tempout, "%s%s%c", output, "1-", c); + std::strcpy(output, tempout); return *this; } BDDRetrace::Dump& BDDRetrace::Dump1::operator<<(int i) { char tempout[1024]; - sprintf (tempout, "%s%s%d", output, "1-", i); - strcpy (output, tempout); + std::sprintf (tempout, "%s%s%d", output, "1-", i); + std::strcpy (output, tempout); return *this; } BDDRetrace::Dump& BDDRetrace::Dump1::operator<<(double r) { char tempout[1024]; - sprintf (tempout, "%s%s%1.0f", output, "1-", r); - strcpy (output, tempout); + std::sprintf (tempout, "%s%s%1.0f", output, "1-", r); + std::strcpy (output, tempout); return *this; } BDDRetrace::Dump& Dump2::operator<<(char c) { char tempout[1024]; - sprintf (tempout, "%s%s%c", output, "2-", c); - strcpy (output, tempout); + std::sprintf (tempout, "%s%s%c", output, "2-", c); + std::strcpy (output, tempout); return *this; } BDDRetrace::Dump& Dump2::operator<<(int i) { char tempout[1024]; - sprintf (tempout, "%s%s%d", output, "2-", i); - strcpy (output, tempout); + std::sprintf (tempout, "%s%s%d", output, "2-", i); + std::strcpy (output, tempout); return *this; } BDDRetrace::Dump& Dump2::operator<<(double r) { char tempout[1024]; - sprintf (tempout, "%s%s%1.0f", output, "2-", r); - strcpy (output, tempout); + std::sprintf (tempout, "%s%s%1.0f", output, "2-", r); + std::strcpy (output, tempout); return *this; } int main() @@ -77,7 +77,7 @@ int main() BDDRetrace::Dump1 d1; Dump2 d2; - sprintf (output, " "); + std::sprintf (output, " "); d1 << 'a'; d1 << 1; @@ -87,10 +87,10 @@ int main() d2 << 1; d2 << 1.0; - if (strcmp (output, " 1-a1-11-12-a2-12-1") == 0) - printf ("PASS\n"); + if (std::strcmp (output, " 1-a1-11-12-a2-12-1") == 0) + std::printf ("PASS\n"); else - { printf ("FAIL\n"); return 1; } + { std::printf ("FAIL\n"); return 1; } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C b/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C index 4fd7e184323..0d053c2cda7 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/ptolemy2.C @@ -1,5 +1,5 @@ // GROUPS passed ptolemy-bugs -#include +#include class PTcl { public: @@ -45,19 +45,19 @@ void printargs(char** argv) { } int PTcl::one(int, char** argv) { - cout << "FAIL\n"; + std::cout << "FAIL\n"; printargs(argv); return 1; } int PTcl::two(int, char** argv) { - cout << "PASS\n"; + std::cout << "PASS\n"; printargs(argv); return 0; } int PTcl::three(int, char** argv) { - cout << "FAIL\n"; + std::cout << "FAIL\n"; printargs(argv); return 1; } diff --git a/gcc/testsuite/g++.old-deja/g++.eh/new1.C b/gcc/testsuite/g++.old-deja/g++.eh/new1.C index 1671dbbe7de..788a39b2958 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/new1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/new1.C @@ -1,8 +1,8 @@ // Test that a throw in foo destroys the A, but does not free the memory. -#include -#include -#include +#include +#include +#include struct A { A(); @@ -34,11 +34,15 @@ void foo (B*) { throw 1; } void* operator new (size_t size) throw (std::bad_alloc) { ++newed; - return (void *) malloc (size); + return (void *) std::malloc (size); } void operator delete (void *p) throw () { --newed; - free (p); + std::free (p); } + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.eh/new2.C b/gcc/testsuite/g++.old-deja/g++.eh/new2.C index ddc8ba82e58..316afffbfc6 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/new2.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/new2.C @@ -1,8 +1,8 @@ // Test that a throw in B's constructor destroys the A and frees the memory. -#include -#include -#include +#include +#include +#include struct A { A(); @@ -35,7 +35,7 @@ void foo (B*) { } void* operator new (size_t size) throw (std::bad_alloc) { ++newed; - return (void *) malloc (size); + return (void *) std::malloc (size); } void operator delete (void *p) throw () @@ -43,3 +43,4 @@ void operator delete (void *p) throw () --newed; free (p); } + diff --git a/gcc/testsuite/g++.old-deja/g++.jason/2371.C b/gcc/testsuite/g++.old-deja/g++.jason/2371.C index 5e45071e6ea..a982d4042e4 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/2371.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/2371.C @@ -7,12 +7,12 @@ // Wendell Baker, Berkeley CAD Group, 1993 (wbaker@ic.Berkeley.EDU) // - #pragma implementation "ListS.h" #pragma implementation "SetLS.h" -#include -#include +#include +#include +using namespace std; # 1 "../../templates/SetLS.h" 1 // -*- C++ -*- diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template24.C b/gcc/testsuite/g++.old-deja/g++.jason/template24.C index 120b717eddd..3315d182c42 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/template24.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/template24.C @@ -1,6 +1,6 @@ // Bug: g++ doesn't find the conversion from ostream_withassign to ostream. -#include +#include template struct A { @@ -8,7 +8,7 @@ struct A { }; template -ostream & operator<< (ostream & os, A & a) +std::ostream & operator<< (std::ostream & os, A & a) { os << a.t; return os; @@ -17,5 +17,6 @@ ostream & operator<< (ostream & os, A & a) int main () { A a = { 1 }; - cout << a << endl; + std::cout << a << std::endl; } + diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template31.C b/gcc/testsuite/g++.old-deja/g++.jason/template31.C index 6fc0e4b5eca..15e91fde7f7 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/template31.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/template31.C @@ -1,6 +1,6 @@ // PRMS Id: 8569 -#include +#include #include using std::vector; @@ -33,10 +33,15 @@ private: int main(int argc, char**argv) { IncludeIt foo; IncludeIt* bar; - exit(0); + std::exit(0); } template class std::__malloc_alloc_template<0>; #ifndef __USE_MALLOC template class std::__default_alloc_template; #endif + + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C b/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C index f6cd45bc664..0f44cb75ed1 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/typeid1.C @@ -1,11 +1,11 @@ #include -#include +#include struct foo { double f(int); }; int main() { double f (int); const std::type_info &r = typeid (f); - cout << typeid(f).name() << endl; - cout << typeid(foo::f).name() << endl; + std::cout << typeid(f).name() << std::endl; + std::cout << typeid(foo::f).name() << std::endl; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/arg1.C b/gcc/testsuite/g++.old-deja/g++.law/arg1.C index 1712f932f13..e017ea0e12a 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arg1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arg1.C @@ -5,18 +5,18 @@ // From: kondo@akane.mech.ibaraki.ac.jp // Date: Fri, 04 Sep 92 17:41:05 JST -#include +#include // check the order of declarations class A { public: - void f(double* p) { cout << "A(double*)\n"; } // ERROR - candidate - void f(int* p) { cout << "A(int*)\n"; } // ERROR - candidate + void f(double* p) { std::cout << "A(double*)\n"; } // ERROR - candidate + void f(int* p) { std::cout << "A(int*)\n"; } // ERROR - candidate }; class B { public: - void f(int* p) { cout << "B(int*)\n"; } // ERROR - candidate - void f(double* p) { cout << "B(double*)\n"; } // ERROR - candidate + void f(int* p) { std::cout << "B(int*)\n"; } // ERROR - candidate + void f(double* p) { std::cout << "B(double*)\n"; } // ERROR - candidate }; int main() @@ -27,3 +27,4 @@ int main() a.f(0);// ERROR - .* b.f(0);// ERROR - .* } + diff --git a/gcc/testsuite/g++.old-deja/g++.law/arg8.C b/gcc/testsuite/g++.old-deja/g++.law/arg8.C index 802471bae47..5f7360d5e49 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arg8.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arg8.C @@ -6,22 +6,22 @@ // Date: Thu, 8 Jul 93 11:47:28 MDT -#include -#include +#include +#include // With this declaration the program will not link. -template ostream & save(ostream & os, Type T); +template std::ostream & save(std::ostream & os, Type T); - template ostream & -save(ostream & os, Type T) { + template std::ostream & +save(std::ostream & os, Type T) { return os << T; } // save int main() { int i = 10; - save((ostream &)cout, i) << endl; + save((std::ostream &)std::cout, i) << std::endl; short int s = 5; - save((ostream &)cout, s) << endl; - printf ("PASS\n"); + save((std::ostream &)std::cout, s) << std::endl; + std::printf ("PASS\n"); } // main diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm12.C b/gcc/testsuite/g++.old-deja/g++.law/arm12.C index 89e2a4d2c82..49d39d5a4db 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arm12.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arm12.C @@ -5,7 +5,7 @@ // Subject: Bad access control with private constructor and derivation // Date: Fri, 28 May 1993 12:39:57 -0400 (EDT) -#include +#include class X { @@ -24,17 +24,17 @@ public: X::X() {// ERROR - .* - cout << "X::X()" << endl; + std::cout << "X::X()" << std::endl; } void X::f() { - cout << "X::f()" << endl; + std::cout << "X::f()" << std::endl; } Y::Y() {// ERROR - within this - cout << "Y::Y()" << endl; + std::cout << "Y::Y()" << std::endl; } @@ -45,3 +45,5 @@ int main() } + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/arm9.C b/gcc/testsuite/g++.old-deja/g++.law/arm9.C index 35658b17cbc..7e79fdcdc56 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/arm9.C +++ b/gcc/testsuite/g++.old-deja/g++.law/arm9.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed ARM-compliance -#include +#include enum f1 { F1 }; @@ -13,13 +13,13 @@ class A { public: void set (f1 f); }; -void A::set (f1 f) { cout << "called A f1\n";} +void A::set (f1 f) { std::cout << "called A f1\n";} class B : public A { public: void set (f2 f); }; -void B::set (f2 f) { cout << "called B\n";} // ERROR - candidate +void B::set (f2 f) { std::cout << "called B\n";} // ERROR - candidate int main() { B b; @@ -31,3 +31,8 @@ int main() { // belong to different scopes. Thus B::set() should have // hidden (completely) the A::set() function. } + + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C b/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C index 434921dd72d..05b3033b1cf 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C +++ b/gcc/testsuite/g++.old-deja/g++.law/bad-error7.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed bad-errors -#include +#include class ParX { @@ -11,7 +11,7 @@ class ParX class X : public ParX { public: - void fn2() { cout << "hi" << endl; } + void fn2() { std::cout << "hi" << std::endl; } }; int main() @@ -22,3 +22,9 @@ int main() (pParX->*p)(); } + + + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C b/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C index 35087c0a51f..188eaac4c16 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C +++ b/gcc/testsuite/g++.old-deja/g++.law/code-gen5.C @@ -5,12 +5,12 @@ // Subject: An error! // Message-ID: <9311160259.AA03353@pi14.arc.umn.edu> -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define ANSI_C @@ -79,7 +79,7 @@ class Vector double assign( int, double ); - friend ostream& operator<<( ostream&, const Vector& m ); + friend std::ostream& operator<<(std::ostream&, const Vector& m ); private: @@ -162,10 +162,10 @@ assign( int rownum, double d ) assert(r); if( rownum > row() || rownum <= 0 ) { - cerr << "Warning: trying to assign out of bounds" << endl; - cerr << "row " << rownum << endl; - cerr << "Vector size " << row() << endl; - abort(); + std::cerr << "Warning: trying to assign out of bounds" << std::endl; + std::cerr << "row " << rownum << std::endl; + std::cerr << "Vector size " << row() << std::endl; + std::abort(); } if( r->count == 1 ) { @@ -232,8 +232,9 @@ VecElem( Vector &vec, int r ) : v(vec), row(r) { if( r < 1 || r > vec.row() ) { - cerr << "Trying to access vector element out of bounds" << endl; - abort(); + std::cerr << "Trying to access vector element out of bounds"; + std::cerr << std::endl; + std::abort(); } } @@ -268,9 +269,9 @@ int main() int i, j; if (makeforms (cen,a,b) != 10) - { printf ("FAIL\n"); return 1; } + { std::printf ("FAIL\n"); return 1; } else - printf ("PASS\n"); + std::printf ("PASS\n"); } @@ -281,3 +282,5 @@ makeforms( Vector cen, Vector **a, Vector **b) return 10; } + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors10.C b/gcc/testsuite/g++.old-deja/g++.law/ctors10.C index 6520087d52f..3a5f3c7a6b3 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors10.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors10.C @@ -6,14 +6,14 @@ // Subject: bug019.cc // Date: Fri, 5 Feb 93 15:51:42 -0800 -#include +#include class Class { - class Err : public ostream + class Err : public std::ostream { public: - Err(void) : ostream(NULL) { } + Err(void) : std::ostream(NULL) { } ~Err(void) { } }; public: diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors12.C b/gcc/testsuite/g++.old-deja/g++.law/ctors12.C index 403bf3fc42b..0d81ced4455 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors12.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors12.C @@ -1,7 +1,7 @@ // GROUPS passed constructors -#include -#include -#include +#include +#include +#include #define MAGIC 7654 @@ -14,9 +14,9 @@ public: complex() { re=im=0; magic=MAGIC; } complex(double d) { re=d; im=0; magic=MAGIC; } complex(double d, double d2) {re=d; im=d2; magic=MAGIC; } - ~complex() {if(magic!=MAGIC) {printf("FAIL\n");exit(1);}} - friend ostream& operator << (ostream& o, const complex& c) - { return o << "(" << c.re << "," << c.im << ")"; } + ~complex() {if(magic!=MAGIC) {std::printf("FAIL\n"); std::exit(1);}} + friend std::ostream& operator << (std::ostream& o, const complex& c) + { return o << "(" << c.re << "," << c.im << ")"; } }; int complex::count=0; @@ -27,7 +27,7 @@ int main() int i; // page 289 for(i=0; i<6; i++) ; - printf ("PASS\n"); + std::printf ("PASS\n"); return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors13.C b/gcc/testsuite/g++.old-deja/g++.law/ctors13.C index aef721be7ce..1442b02eb56 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors13.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors13.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed constructors -#include +#include class A { A() {} // private constructor// ERROR - .* @@ -9,8 +9,10 @@ class A { int main() { A* a = new A();// ERROR - .* if (a) { - cout << "a != NULL\n"; + std::cout << "a != NULL\n"; } else { - cout << "a == NULL\n"; + std::cout << "a == NULL\n"; } } + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors17.C b/gcc/testsuite/g++.old-deja/g++.law/ctors17.C index 1f5f0b00c6c..5fe1724df78 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors17.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors17.C @@ -7,9 +7,9 @@ // Date: Tue, 15 Jun 1993 18:34:14 +0200 (MET DST) -#include +#include -class X : public ifstream { // ERROR - candidate +class X : public std::ifstream { // ERROR - candidate public: X(int a, char *b) {} // ERROR - candidate }; diff --git a/gcc/testsuite/g++.old-deja/g++.law/ctors6.C b/gcc/testsuite/g++.old-deja/g++.law/ctors6.C index a46f4e89bdb..b2d0a197d51 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/ctors6.C +++ b/gcc/testsuite/g++.old-deja/g++.law/ctors6.C @@ -1,8 +1,8 @@ // Build don't link: // GROUPS passed constructors -#include +#include -double foo(double_complex *a) +double foo(std::complex *a) { return 0.0; } @@ -10,6 +10,6 @@ double foo(double_complex *a) double bar(void) { - double_complex v[10]; + std::complex v[10]; return foo(v); } diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt16.C b/gcc/testsuite/g++.old-deja/g++.law/cvt16.C index c539c96e536..2d75c4c3106 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/cvt16.C +++ b/gcc/testsuite/g++.old-deja/g++.law/cvt16.C @@ -6,7 +6,7 @@ // Subject: g++ bug // Date: Mon, 12 Apr 93 10:47:01 MDT -#include +#include class B { }; @@ -22,8 +22,9 @@ public: main() { A a(37); //cout << a << endl; - cout << (short)a << endl; + std::cout << (short)a << std::endl; return 0; } // main + diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt2.C b/gcc/testsuite/g++.old-deja/g++.law/cvt2.C index c37098536e9..b7439f5d521 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/cvt2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/cvt2.C @@ -1,9 +1,9 @@ // GROUPS passed conversions -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class cvec { public: @@ -25,18 +25,17 @@ void A(const char* s) { // s still ok here - ifstream inf(s); - if (strncmp ("aaa", s, 3)) + std::ifstream inf(s); + if (std::strncmp ("aaa", s, 3)) { - printf ("FAIL\n"); - exit (1); + std::printf ("FAIL\n"); + std::exit (1); } else - printf ("PASS\n"); + std::printf ("PASS\n"); } int main() { A(B("aaa")); } - diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt7.C b/gcc/testsuite/g++.old-deja/g++.law/cvt7.C index fc775c4f079..7529bc24bbc 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/cvt7.C +++ b/gcc/testsuite/g++.old-deja/g++.law/cvt7.C @@ -5,8 +5,7 @@ // Message-Id: <9208250205.AA26351@icsib43.ICSI.Berkeley.EDU> // Subject: implicit int. convs. from member refs. in switch expressions -#include -#include +#include class A { @@ -58,10 +57,10 @@ int main() switch (ar2) { case 1: - printf ("PASS\n"); + std::printf ("PASS\n"); break; default: - { printf ("FAIL\n"); return 1; } + { std::printf ("FAIL\n"); return 1; } } B b(a); @@ -72,3 +71,10 @@ int main() return 0; } + + + + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/except5.C b/gcc/testsuite/g++.old-deja/g++.law/except5.C index 623d0d8587f..18174e7fcf5 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/except5.C +++ b/gcc/testsuite/g++.old-deja/g++.law/except5.C @@ -7,7 +7,8 @@ // Subject: exception's bug? // Date: Wed, 10 Nov 1993 11:07:12 -0500 -#include +#include + class X { int *a; int sz; @@ -33,7 +34,7 @@ main() for (int i = 0; i < 12; i++) c[i] = 1; } catch (X::range) { - cerr << "invalid range\n"; + std::cerr << "invalid range\n"; } return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C index 18a026d1502..2fc1ddf5326 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C @@ -6,7 +6,7 @@ // Subject: More on [g++ 2.1 : overloaded function selection incorrect] // Message-ID: <9205212240.AA17934@ndc.com> -#include +#include inline int max(int a, int b) {return a > b ? a : b;}; // ERROR - candidate inline double max(double a, double b) {return a > b ? a : b;}; // ERROR - candidate @@ -21,8 +21,8 @@ int main() { // about the declaration above static void foo(int i, int j, double x, double y) { - cout << "Max(int): " << max(i,j) << " Max(double): " << + std::cout << "Max(int): " << max(i,j) << " Max(double): " << max(x,y) << '\n'; - cout << "Max(int, double): " << max(i, y) << '\n';// ERROR - + std::cout << "Max(int, double): " << max(i, y) << '\n';// ERROR - } diff --git a/gcc/testsuite/g++.old-deja/g++.law/nest3.C b/gcc/testsuite/g++.old-deja/g++.law/nest3.C index eac308e566a..d390bc48582 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/nest3.C +++ b/gcc/testsuite/g++.old-deja/g++.law/nest3.C @@ -1,15 +1,15 @@ // Build don't link: // GROUPS passed nest -#include +#include struct inner { - static void f() { cout << "inner::f()\n";} + static void f() { std::cout << "inner::f()\n";} }; struct outer { struct inner { - static void f() { cout << "outer::inner::f()\n";} + static void f() { std::cout << "outer::inner::f()\n";} }; static void f() { @@ -20,6 +20,6 @@ struct outer { int main() { outer::f(); - cout << endl; + std::cout << std::endl; return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.law/operators32.C b/gcc/testsuite/g++.old-deja/g++.law/operators32.C index 26e439876a9..daebcefd339 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/operators32.C +++ b/gcc/testsuite/g++.old-deja/g++.law/operators32.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed operators -#include +#include // // frees space allocated for N-D array @@ -43,9 +43,9 @@ long d1 = 3, d2 = 4; class foo { public: -foo() {cout << "foo created" << endl; } +foo() {std::cout << "foo created" << std::endl; } -~foo() {cout << "foo deleted" << endl; } +~foo() {std::cout << "foo deleted" << std::endl; } }; foo **f2; diff --git a/gcc/testsuite/g++.old-deja/g++.law/vbase1.C b/gcc/testsuite/g++.old-deja/g++.law/vbase1.C index 42282d57df8..a013c72901b 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/vbase1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/vbase1.C @@ -7,11 +7,11 @@ // Message-ID: <317f1j$o9c@agate.berkeley.edu> -#include +#include class a { protected: - virtual void foo() { cout << "Class A\n";} + virtual void foo() { std::cout << "Class A\n";} }; class b : public virtual a {}; @@ -26,3 +26,4 @@ int main() { test.bar(); } + diff --git a/gcc/testsuite/g++.old-deja/g++.law/virtual3.C b/gcc/testsuite/g++.old-deja/g++.law/virtual3.C index 0e25a3e70e1..8c30b7689a4 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/virtual3.C +++ b/gcc/testsuite/g++.old-deja/g++.law/virtual3.C @@ -5,12 +5,12 @@ // Date: 4 Nov 1993 22:57:36 -0500 // Message-ID: <9311041820.AA05942@ramjet.multinet.DE> -#include -#include +#include +#include using namespace std; -class BugStream : public ostrstream { +class BugStream : public ostringstream { public: BugStream() {} BugStream& eval(); @@ -26,12 +26,12 @@ BugStream& BugStream::eval() *this << ends; // eval the command and set the status - char* s = str(); + const char* s = str().data(); cerr << s << endl; // reset the stream for the next command clear(ios::goodbit); - rdbuf()->freeze(0); + // rdbuf()->freeze(0); seekp(0); return *this; diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility1.C b/gcc/testsuite/g++.old-deja/g++.law/visibility1.C index 67f4bcd9919..736c11ab8ad 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility1.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed visibility -#include +#include @@ -8,17 +8,17 @@ class base { //========== void base_priv(char * n) - { cout << "base_priv called from: " << n << "\n"; }; + { std::cout << "base_priv called from: " << n << "\n"; }; protected: void base_prot(char * n) - { cout << "base_prot called from: " << n << "\n"; }; + { std::cout << "base_prot called from: " << n << "\n"; }; public: void base_publ(char * n) - { cout << "base_publ called from: " << n << "\n"; }; + { std::cout << "base_publ called from: " << n << "\n"; }; void test(char * n) { base_publ(n); base_prot(n); base_priv(n); } @@ -57,12 +57,12 @@ int main(int argc, char *argv[]) base b; b.base_publ("base class object"); b.test("member of base class object"); - cout << "\n"; + std::cout << "\n"; derived pd; pd.test("member of derived class object"); derived_friend(); - cout << "\n"; + std::cout << "\n"; } /* main */ diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility10.C b/gcc/testsuite/g++.old-deja/g++.law/visibility10.C index 14dfa333dea..7f68af05b24 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility10.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility10.C @@ -1,12 +1,12 @@ // Build don't link: // GROUPS passed visibility -#include +#include class base { public: - void f1 () { cout << "f1" << endl; }; - void f2 () { cout << "f2" << endl; }; + void f1 () { std::cout << "f1" << std::endl; }; + void f2 () { std::cout << "f2" << std::endl; }; }; class deriv : public base { @@ -19,3 +19,4 @@ int main () d.f2(); } + diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C index 7f634e20cd8..dbde720d276 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility13.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility13.C @@ -6,11 +6,13 @@ // Subject: class, template and their scoping problem // Message-ID: <9307130521.AA18312@oahu.cs.ucla.edu> -#include -#include +#include +#include // --------------- Array.h && Array.cc ------------------ +using namespace std; + const int ArraySize = 12; template diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility17.C b/gcc/testsuite/g++.old-deja/g++.law/visibility17.C index fa4d6db69b9..2aa08a09169 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility17.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility17.C @@ -5,8 +5,8 @@ // Date: Thu, 05 Aug 1993 17:23:20 -0700 // Subject: Access to private constructor. // Message-ID: <9308060023.AA10283@neptune.caere.com> -#include -#include +#include +#include class Base { @@ -33,13 +33,13 @@ private: Base::Base() { // ERROR - private - name_ = strcpy(new char[strlen(" ") + 1], " "); + name_ = std::strcpy(new char[std::strlen(" ") + 1], " "); } Base::Base(char* str) { // ERROR - private if(str != NULL) - name_ = strcpy(new char[strlen(str) + 1], str); + name_ = std::strcpy(new char[std::strlen(str) + 1], str); } Derived::Derived(int n, char* str) : Base(str) @@ -59,6 +59,8 @@ int main() // Derived* d = new Derived(10, "test"); Derived* d = new Derived(10); - cerr << d->getNum() << "\t" << d->getName() << endl; + std::cerr << d->getNum() << "\t" << d->getName() << std::endl; } + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility2.C b/gcc/testsuite/g++.old-deja/g++.law/visibility2.C index 5806fc564b7..9d038d46891 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility2.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility2.C @@ -1,6 +1,6 @@ // Build don't link: // GROUPS passed visibility -#include +#include @@ -8,17 +8,17 @@ class base { //========== void base_priv(char * n) - { cout << "base_priv called from: " << n << "\n"; }; + { std::cout << "base_priv called from: " << n << "\n"; }; protected: void base_prot(char * n) - { cout << "base_prot called from: " << n << "\n"; }; + { std::cout << "base_prot called from: " << n << "\n"; }; public: void base_publ(char * n) - { cout << "base_publ called from: " << n << "\n"; }; + { std::cout << "base_publ called from: " << n << "\n"; }; void test(char * n) { base_publ(n); base_prot(n); base_priv(n); } @@ -57,12 +57,12 @@ int main(int argc, char *argv[]) base b; b.base_publ("base class object"); b.test("member of base class object"); - cout << "\n"; + std::cout << "\n"; derived pd; pd.test("member of derived class object"); derived_friend(); - cout << "\n"; + std::cout << "\n"; } /* main */ diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility22.C b/gcc/testsuite/g++.old-deja/g++.law/visibility22.C index a9448c07fee..a03421ab6c9 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility22.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility22.C @@ -7,7 +7,7 @@ // Message-ID: <9308121348.aa26256@Paris.ics.uci.edu> // 5.cc -#include +#include class A { int x; diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility25.C b/gcc/testsuite/g++.old-deja/g++.law/visibility25.C index 607e25a00ce..56a7df60f18 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility25.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility25.C @@ -5,7 +5,7 @@ // Date: Wed, 17 Nov 93 21:30:32 EST // Subject: gcc 2.5.3 - can't privately inherit and contain same class // Message-ID: <9311171030.AA00604@mencon> -#include +#include class A { public: diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility7.C b/gcc/testsuite/g++.old-deja/g++.law/visibility7.C index 764da35d9db..ec7947c5503 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility7.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility7.C @@ -5,7 +5,7 @@ // Date: Wed, 21 Apr 93 09:42:07 +0100 // Subject: /*** BUG REPORT : THE MYTH OF PRIVATE INHERITANCE ***/ // Message-ID: <9304210842.AA01815@life.ai.mit.edu> -#include +#include class A { private: @@ -64,8 +64,10 @@ int main() B* bobject = new B(2, 1); C* cobject = new C(bobject); cobject->setBValue(8); - cout << cobject->getBValue() << endl; + std::cout << cobject->getBValue() << std::endl; delete bobject; delete cobject; } + + diff --git a/gcc/testsuite/g++.old-deja/g++.law/weak.C b/gcc/testsuite/g++.old-deja/g++.law/weak.C index a799d0a0bd1..5937979f301 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/weak.C +++ b/gcc/testsuite/g++.old-deja/g++.law/weak.C @@ -5,16 +5,16 @@ // libc-5.4.xx has __IO_putc in its static C library, which can conflict // with the copy of __IO_putc in the libstdc++ library built by egcs. -#include -#include -#include +#include +#include +#include -istream x (0); +std::istream x (0); main () { x.get(); - putc(0, 0); - fgets(0, 0, 0); + std::putc(0, 0); + std::fgets(0, 0, 0); x.get((char*) 0, 0); } diff --git a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C index 4fc513ff0f5..c92afde4cd4 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/eh2.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/eh2.C @@ -1,8 +1,8 @@ // Special g++ Options: -fexceptions // excess errors test - XFAIL a29k-*-* sparc64-*-elf arm-*-pe -#include -#include +#include +#include class Vector { private: @@ -57,9 +57,9 @@ f(Vector& v) { try { do_something( v ); } catch (Vector::Range& r) { - cout << "Invalid vector range " << r.value() - << " caught in f()" << endl; - exit(0); + std::cout << "Invalid vector range " << r.value() + << " caught in f()" << std::endl; + std::exit(0); } } @@ -69,3 +69,6 @@ main() { f( v ); return 1; } + + + diff --git a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C b/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C index 9b7aadc5081..cc98cfae2fa 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/memoize1.C @@ -1,4 +1,4 @@ // Build don't link: // Special g++ Options: -fsave-memoized -#include +#include diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net34.C b/gcc/testsuite/g++.old-deja/g++.mike/net34.C index dada4cd13f0..9cf550c126e 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net34.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net34.C @@ -1,6 +1,6 @@ // Special g++ Options: -#include +#include class foo { public: @@ -25,10 +25,10 @@ class multiple : public bar_1, public bar_2 { public: multiple(int i1, int i2) : bar_1(i1), bar_2(i2) {} void print() { - cout << "bar_1::k -> " << bar_1::k << "\n"; - cout << "bar_2::k -> " << bar_2::k << "\n"; - cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n"; - cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n"; + std::cout << "bar_1::k -> " << bar_1::k << "\n"; + std::cout << "bar_2::k -> " << bar_2::k << "\n"; + std::cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n"; + std::cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n"; } }; @@ -36,3 +36,5 @@ int main() { multiple m(1,2); m.print(); } + + diff --git a/gcc/testsuite/g++.old-deja/g++.mike/net46.C b/gcc/testsuite/g++.old-deja/g++.mike/net46.C index 9a985450a4a..bacee852c85 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/net46.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/net46.C @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include int fail = 1; @@ -14,7 +14,7 @@ void *operator new(size_t size) throw (std::bad_alloc) { } int main() { - cout << ""; + std::cout << ""; in_main = 1; new int; return fail; diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p658.C b/gcc/testsuite/g++.old-deja/g++.mike/p658.C index 842ae8b78d6..b9137fb8ca2 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p658.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p658.C @@ -1,7 +1,7 @@ // prms-id: 658 -#include -#include +#include +#include /* We may not find the libg++ . */ #ifndef FALSE @@ -65,8 +65,8 @@ void Object::OK() const { if (_destructed) { - cerr << "FAILURE - reference was made to a destructed object\n"; - abort(); + std::cerr << "FAILURE - reference was made to a destructed object\n"; + std::abort(); } } @@ -98,3 +98,5 @@ Char::operator char () const { return _c; } + + diff --git a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C index e44c5fafdc5..3403abf0999 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/rtti1.C @@ -1,4 +1,4 @@ // Build don't link: #include -#include +#include diff --git a/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C b/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C index 99a1dc176e4..c6eadaa3dd5 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/sibcall1.C @@ -1,13 +1,13 @@ // Special g++ Options: -O2 -#include +#include -ostream& foo (char *x, ostream &y) +std::ostream& foo (char *x, std::ostream &y) { return y << "" << x; } int main () { - foo ("", cout); + foo ("", std::cout); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C index b87be9c1ae9..7a7c56cd34f 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C @@ -1,8 +1,10 @@ #include -#include +#include #include #include +using namespace std; + // empty parameter class with a minimal set of operations // if there are no weights for edges necessary struct Empty diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C index f3c28b9ac65..88d33b148d7 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb113.C @@ -1,5 +1,5 @@ // Build don't link: -#include +#include class X : public std::streambuf { diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C index 30eab786f34..fc404d9ae32 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb115.C @@ -1,9 +1,9 @@ // Special g++ Options: -O -#include +#include #include int main() { int *i1, *i2; - cerr << (typeid(i1)==typeid(i2)) << endl; + std::cerr << (typeid(i1)==typeid(i2)) << std::endl; } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C index 23498c78554..b191ac11717 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C @@ -1,7 +1,7 @@ // Test for obsolete specialization syntax. Turn off -pedantic. // Special g++ Options: -#include +#include #include template @@ -13,7 +13,7 @@ public: template void A::test(){ - cerr << "test for " << typeid(*this).name() << endl; + std::cerr << "test for " << typeid(*this).name() << std::endl; } // Specialization declaration void @@ -22,7 +22,7 @@ A::test(); // Specialization definition void A::test(){ - cerr << "specialization for " << typeid(*this).name() << endl; + std::cerr << "specialization for " << typeid(*this).name() << std::endl; } @@ -35,3 +35,4 @@ main(){ return 0; } + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C index 902d4631ac1..f56f3137e64 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb15.C @@ -1,18 +1,18 @@ // Build don't link: -#include -#include +#include +#include struct A { A() { - cerr<<"A constructing\n"; + std::cerr<<"A constructing\n"; throw 1; } void *operator new(size_t sz) { - cerr<<"A allocated\n"; + std::cerr<<"A allocated\n"; return ::operator new(sz); } void operator delete (void *p) { - cerr<<"A deleted\n"; + std::cerr<<"A deleted\n"; ::operator delete (p); } }; @@ -23,3 +23,6 @@ int main() { } catch (...) { } } + + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C index f534f4891d7..11b38cdc731 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb21.C @@ -1,6 +1,6 @@ #include -#include +#include using namespace std; @@ -16,7 +16,7 @@ std::vector connections; int main() { - ostrstream str; + ostringstream str; connections.insert(connections.end(), connection_t()); diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C index b1f01043817..7ea7b41205b 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb24.C @@ -1,5 +1,5 @@ // Build don't link: -#include +#include template < class T > class X @@ -19,5 +19,5 @@ class Y : public X using X::x; - void f () { cout << x << endl; } + void f () { std::cout << x << std::endl; } }; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C index d257043e46a..ccf6027102a 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb3.C @@ -1,5 +1,5 @@ // Build don't link: -#include +#include template class Vec { public: @@ -8,4 +8,4 @@ public: void operator=(const Vec &v) { data = new T; } T *data; }; -template class Vec >; +template class Vec >; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C index c116ab4cd4d..9814697b141 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb30.C @@ -1,7 +1,7 @@ // Build don't link: -#include +#include -class bifstream : public ifstream { +class bifstream : public std::ifstream { public: bifstream(); // ~bifstream(); diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C index 1a18af5b4c8..33a12b89ac2 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb31.C @@ -1,4 +1,4 @@ -#include +#include int main() { try { @@ -15,3 +15,5 @@ int main() { } return 0; } + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C index 3797ab3740f..9664f42e941 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb33.C @@ -1,11 +1,11 @@ -#include -#include +#include +#include int main() { - printf("If you see this, you don't have a problem!\n"); + std::printf("If you see this, you don't have a problem!\n"); #ifdef EXPOSE_BUG - ifstream a; + std::ifstream a; #endif } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C index 4d194e05010..f243facec8a 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb39.C @@ -1,10 +1,8 @@ // Build don't link: -#include -#include -// #include -// #include -#include -#include +#include +#include +#include +#include using namespace std; @@ -13,7 +11,8 @@ extern bool foo2 (ostream &out, istream &in); bool foo1 (ostream &out, const char *in) { - strstreambuf sb (in, (int) strlen (in)); + string tmp(in, strlen(in)); + stringbuf sb (tmp); istream fmt (&sb); return foo2 (out, fmt); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C index b51d3eafb98..69728967480 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C @@ -1,6 +1,6 @@ // Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot. -#include +#include class some_base { @@ -31,7 +31,7 @@ public: class some_derived::func(derived_func_args &a) // ERROR - illegal member syntax { - cout << a.i << ' ' << a.f << endl; + std::cout << a.i << ' ' << a.f << std::endl; } int diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C index 0bd69e37648..1cc7509314a 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb41.C @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include -ostream_iterator oo(cout); +std::ostream_iterator oo(std::cout); int main() { diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C index 04ff13d698f..36042337417 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb44.C @@ -4,9 +4,11 @@ // Also, the template instantiation does not provide the missing // friend function, the non-template function does -#include -#include -#include +#include +#include +#include + +using namespace std; template class Vector diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C index ad077e38dc3..d4a9d65eb9a 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb46.C @@ -1,4 +1,4 @@ -#include +#include class A1 { friend class B; @@ -22,6 +22,9 @@ int main() A1* a=new A3; B b(a); - if (b.itsA) cout << "cast ok" << endl; else cout << "cast failed" << endl; + if (b.itsA) + std::cout << "cast ok" << std::endl; + else + std::cout << "cast failed" << std::endl; return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C index bcf9968d121..b8ac4035e68 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb54.C @@ -1,8 +1,9 @@ -#include -#include +#include +#include +#include int main() { - cout << setbase(3) << endl; - exit (0); + std::cout << std::setbase(3) << std::endl; + std::exit (0); } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C index 11f98bba89b..0ab10d5d424 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb55.C @@ -2,11 +2,11 @@ // Since the constructor is in streambuf.h, additional diagnostics are // produced, which are not really supported in the old-deja framework -#include +#include void t( char* buf ) { - istrstream str = buf; //ERROR - inaccessible copy constructor + std::istrstream str = buf; //ERROR - inaccessible copy constructor } diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C index d79865f21d9..00ef6b0b62b 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb66.C @@ -1,5 +1,5 @@ -#include -#include +#include +#include int bar () { @@ -17,6 +17,10 @@ int main () { } -// cout << "i = " << i << endl; +// std::cout << "i = " << i << std::endl; assert (i == 0) ; } + + + + diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C index 75695de92d6..622d3ec9d3f 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb73.C @@ -1,7 +1,7 @@ // Special g++ Options: -O -Wall // Depletes VM. -#include +#include #include #include using namespace std; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C index f5fbb6f2515..3db45cc8007 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb77.C @@ -1,15 +1,15 @@ -#include -#include +#include +#include using namespace std; int main(int, char* []) { - strstream s; + stringstream s; s << "line 1\nline 2\n\nline 4"; - s << ends; + s << std::ends; int nLine = 0; @@ -22,7 +22,7 @@ main(int, char* []) } ++nLine; - cout << nLine << ": " << line << endl; + std::cout << nLine << ": " << line << std::endl; if( nLine > 10 ) { // stop infinite loop break; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C index 5691532b99f..453916ed097 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb79.C @@ -1,5 +1,7 @@ // Makes bogus x86 assembly code. -#include +#include + +using namespace std; template T max(T a, T b) diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C index 7121e140078..0f42cf4afa7 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/eb83.C @@ -1,7 +1,7 @@ // Skip if not native // Special g++ Options: -fprofile-arcs -ftest-coverage void -swap(int& x, int& y) throw() +test_swap(int& x, int& y) throw() { int tmp = x; x = y; @@ -12,5 +12,5 @@ main() { int i = 5; int j = 7; - swap(i, j); + test_swap(i, j); } diff --git a/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C b/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C index 2fea4edf6af..b7a47faa25a 100644 --- a/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C +++ b/gcc/testsuite/g++.old-deja/g++.warn/iomanip.C @@ -3,10 +3,11 @@ // Special g++ Options: -O -Winline // Build don't link: -#include +#include +#include void f() { - cout << setw(3); + std::cout << std::setw(3); }