new, update
authorJason Merrill <jason@gcc.gnu.org>
Sat, 9 May 1998 18:08:52 +0000 (14:08 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 9 May 1998 18:08:52 +0000 (14:08 -0400)
From-SVN: r19649

52 files changed:
gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
gcc/testsuite/g++.old-deja/g++.eh/rethrow3.C
gcc/testsuite/g++.old-deja/g++.eh/spec1.C
gcc/testsuite/g++.old-deja/g++.eh/spec2.C
gcc/testsuite/g++.old-deja/g++.eh/spec3.C
gcc/testsuite/g++.old-deja/g++.eh/spec4.C
gcc/testsuite/g++.old-deja/g++.jason/template31.C
gcc/testsuite/g++.old-deja/g++.jason/typeid1.C
gcc/testsuite/g++.old-deja/g++.law/operators27.C
gcc/testsuite/g++.old-deja/g++.mike/dyncast1.C
gcc/testsuite/g++.old-deja/g++.mike/dyncast2.C
gcc/testsuite/g++.old-deja/g++.mike/dyncast7.C
gcc/testsuite/g++.old-deja/g++.mike/eh23.C
gcc/testsuite/g++.old-deja/g++.mike/eh25.C
gcc/testsuite/g++.old-deja/g++.mike/eh33.C
gcc/testsuite/g++.old-deja/g++.mike/eh34.C
gcc/testsuite/g++.old-deja/g++.mike/eh47.C
gcc/testsuite/g++.old-deja/g++.mike/eh48.C
gcc/testsuite/g++.old-deja/g++.mike/eh50.C
gcc/testsuite/g++.old-deja/g++.mike/eh51.C
gcc/testsuite/g++.old-deja/g++.mike/eh55.C
gcc/testsuite/g++.old-deja/g++.mike/ns11.C
gcc/testsuite/g++.old-deja/g++.mike/ns13.C
gcc/testsuite/g++.old-deja/g++.mike/ns14.C
gcc/testsuite/g++.old-deja/g++.mike/ns9.C
gcc/testsuite/g++.old-deja/g++.ns/alias1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/koenig1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/lookup1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/lookup2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns10.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns11.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns12.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns4.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns5.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns6.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns7.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns8.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/ns9.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/overload1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/overload2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/overload3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/overload4.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/overload5.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/template1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/template2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/using1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.ns/using2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/temporary1.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.pt/scope1.C [new file with mode: 0644]

index b6d4830b14d47aa4cb9f4562cea62fc43ddbe7dc..75be8ab819ad95e5771c616b6fe59dbace40211e 100644 (file)
@@ -1,13 +1,10 @@
 // g++ 1.37.1 bug 900404_04
 
-// The ANSI C does not allow vacuous statements (i.e. just semicolons)
-// at the file-scope level.
-
-// The current C++ Reference Manual does not indicate whether these should
-// be considered legal or not.
-
-// I am forced to conclude that C++ will follow ANSI C in this regard,
-// and that these are therefore not legal.
+// [dcl.dcl] explains that simple-declarations may omit the
+// init-declarator-list only if the decl-specifier-seq declares a
+// class, i.e. if it contains a class-specifier, an
+// elaborated-type-specifier with class key, or an enum-specifier. The
+// declaration below contains neither.
 
 // g++ fails to flag errors for such usage.
 
index 355bedc64c98a644501b925236999cb4fa82bbf1..bea447bf27f21d2b9898cc30681cd5642c2f0936 100644 (file)
@@ -33,6 +33,6 @@ eh_test (int level)
 
 main ()
 {
-  set_terminate (&eh_terminate);
+  std::set_terminate (&eh_terminate);
   eh_test (0);
 }
index 73ee960f120fd2899a77ab82118af38fbad9484e..8f450706b041e426a688cf3988764b530dc4d0c9 100644 (file)
@@ -8,15 +8,15 @@ void my_term ()  { exit (1); }
 void my_unexp () { throw 42; }
 
 void
-f () throw (char, int, bad_exception)
+f () throw (char, int, std::bad_exception)
 {
   throw 'a';
 }
 
 main ()
 {
-  set_terminate (my_term);
-  set_unexpected (my_unexp);
+  std::set_terminate (my_term);
+  std::set_unexpected (my_unexp);
 
   try
     {
@@ -30,7 +30,7 @@ main ()
     {
       return 3;
     }
-  catch (bad_exception)
+  catch (std::bad_exception)
     {
       return 4;
     }
index 440137757616eeaeafb7b04d1ca156a7291e034e..41774bf7de4b61e822213830e13fb52ab22fe212 100644 (file)
@@ -8,15 +8,15 @@ void my_term ()  { exit (1); }
 void my_unexp () { throw 42; }
 
 void
-f () throw (int, bad_exception)
+f () throw (int, std::bad_exception)
 {
   throw 'a';
 }
 
 main ()
 {
-  set_terminate (my_term);
-  set_unexpected (my_unexp);
+  std::set_terminate (my_term);
+  std::set_unexpected (my_unexp);
 
   try
     {
@@ -30,7 +30,7 @@ main ()
     {
       return 0;
     }
-  catch (bad_exception)
+  catch (std::bad_exception)
     {
       return 4;
     }
index 148be763214a2dc908356e366a83e6157c6a0312..602cd6f5b612a9a06fac78f16e271cf4411427ec 100644 (file)
@@ -8,15 +8,15 @@ void my_term ()  { exit (1); }
 void my_unexp () { throw 42; }
 
 void
-f () throw (bad_exception)
+f () throw (std::bad_exception)
 {
   throw 'a';
 }
 
 main ()
 {
-  set_terminate (my_term);
-  set_unexpected (my_unexp);
+  std::set_terminate (my_term);
+  std::set_unexpected (my_unexp);
 
   try
     {
@@ -30,7 +30,7 @@ main ()
     {
       return 3;
     }
-  catch (bad_exception)
+  catch (std::bad_exception)
     {
       return 0;
     }
index d8b8ce7ed32444929fde9e7eea09a303d5e9d7a1..adcf6751b1ae4270e3986307270b579eb71472c8 100644 (file)
@@ -15,8 +15,8 @@ f () throw (short)
 
 main ()
 {
-  set_terminate (my_term);
-  set_unexpected (my_unexp);
+  std::set_terminate (my_term);
+  std::set_unexpected (my_unexp);
 
   try
     {
@@ -30,7 +30,7 @@ main ()
     {
       return 3;
     }
-  catch (bad_exception)
+  catch (std::bad_exception)
     {
       return 4;
     }
index 8870bf4ec4eccab6a9a558ece21f15a09a82b841..fdea9d60c850faf03a66e952f0bf35f883cf5063 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <iostream.h>
 #include <vector>
+
+using std::vector;
  
 class Component {
     int george;
@@ -34,5 +36,5 @@ main(int argc, char**argv)   {
     exit(0);
 }
 
-template class __malloc_alloc_template<0>;
-template class __default_alloc_template<false, 0>;
+template class std::__malloc_alloc_template<0>;
+template class std::__default_alloc_template<false, 0>;
index 90eeb4558fe28267dd8954e89df8342d4323d3a6..f7fcbae3c7020fadd8f4882b3a7bd8343054c366 100644 (file)
@@ -5,7 +5,7 @@ struct foo { double f(int); };
 
 main() {
   double f (int);
-  const type_info &r = typeid (f);
+  const std::type_info &r = typeid (f);
   cout << typeid(f).name() << endl;
   cout << typeid(foo::f).name() << endl;
 }
index f8ca9d173178d8d774291d923b2be2b6ee7d4e7b..6a07176ba3a0c19b93f8b68abfbe18841a8531a3 100644 (file)
@@ -11,7 +11,7 @@ int FLAG=0;
 
 extern "C" int printf( const char *, ...);
 
-void * operator new(size_t, const nothrow_t&) throw()         { FLAG=1; return 0; }
+void * operator new(size_t, const std::nothrow_t&) throw()         { FLAG=1; return 0; }
 
 class K {
 private:
@@ -24,7 +24,7 @@ public:
 
 int main(void)
 {
-    K * pK = new (nothrow) K( 10);
+    K * pK = new (std::nothrow) K( 10);
     if ( FLAG != 1 )
        printf ("FAIL\n");
     else
index 0b6fd383d99a5e1c8afa0654d5e7e6632313c3be..fbcc489eaaf597ea0c2e1acef7b9f681db15e357 100644 (file)
@@ -15,7 +15,7 @@ main() {
   B b;
   try {
     (void)dynamic_cast<D&>(b);
-  } catch (bad_cast) {
+  } catch (std::bad_cast) {
     return 0;
   }
   return 1;
index dbad6414ae43bfc20f834acc7a8faebc8e459492..ba7a39edbaaf7d13c01c1bb44ff5b9f14232a7c0 100644 (file)
@@ -18,7 +18,7 @@ main() {
   try {
     void *vp = &dynamic_cast<D&>(*b);
     return 1;
-  } catch (bad_cast) {
+  } catch (std::bad_cast) {
     return 0;
   }
   return 1;
index 1373d0f5f6e4e136d2ab06fc9bdc52bcdaddcffd..b1a55a43592cf04cc865e5b53677529eadb71825 100644 (file)
@@ -21,7 +21,7 @@ int main() {
   try {
     B b;
     x (b);
-  } catch (exception& e) {
+  } catch (std::exception& e) {
     // If we get a bad_cast, it is wrong.
     return 1;
   }
index 17a9669388f3bbda626ca16a9abe16b3f283eaef..27fc53d8eebf51fb14bec94a4d6c4e454bf72c24 100644 (file)
@@ -36,7 +36,7 @@ void my_terminate() {
 }
 
 main() {
-  set_terminate (my_terminate);
+  std::set_terminate (my_terminate);
   try {
     bar();
   } catch (...) {
index 66045b1cf56f08b432288d3a73bc7d0f707c579d..52754b5335930e79b956aababdc91bd41e56f8bd 100644 (file)
@@ -10,7 +10,7 @@ void my_terminate() {
 struct A {
   A() { }
   ~A() {
-    set_terminate (my_terminate);
+    std::set_terminate (my_terminate);
     throw 1;           // This throws from EH dtor, should call my_terminate
   }
 };
index ce57067c6ef046891f4ae0ef062a8142db28307f..49214f12c882429946c72fc38d66c200e43947b1 100644 (file)
@@ -10,7 +10,7 @@ void my_unexpected() {
 foo() throw (int) { throw "Hi"; }
 
 main() {
-  set_unexpected (my_unexpected);
+  std::set_unexpected (my_unexpected);
   try {
     foo();
   } catch (int i) {
index 986db272429f2d215e7b7bdb0f754cf01d383c69..0f278010023d579904d7b90f6d9648cfbdad40c8 100644 (file)
@@ -10,7 +10,7 @@ void my_unexpected() {
 foo() throw () { throw "Hi"; }
 
 main() {
-  set_unexpected (my_unexpected);
+  std::set_unexpected (my_unexpected);
   foo();
   return 1;
 }
index 708de10d9a5806f8c5ebfd66e6bd551417326ffc..043a6174a6fb1120882a69c72b17f6d474b639b5 100644 (file)
@@ -14,7 +14,7 @@ main() {
   } catch (...) {
   }
   try {
-    set_terminate (myterm);
+    std::set_terminate (myterm);
     throw;
   } catch (...) {
     return 1;
index 5cefacd5f1e01aa3d80ead43aba79b329b139962..351fc4f60a852fd2475ec53f8680bad64c0b1882 100644 (file)
@@ -2,7 +2,7 @@
 // excess errors test - XFAIL a29k-*-* sparc64-*-elf sh-*-* arm-*-pe**-*
 
 #include <exception>
-
+using std::uncaught_exception;
 class A {
 public:
   ~A() {
index 1ae2d9cc93797692dad223e3290a184f08df005d..0747e1032ef20a48644e96f59df3548798f2e696 100644 (file)
@@ -10,7 +10,7 @@ void my_unexpected() {
 template <class T> int foo(T) throw (int) { throw "Hi"; }
 
 main() {
-  set_unexpected (my_unexpected);
+  std::set_unexpected (my_unexpected);
   try {
     foo(1);
   } catch (int i) {
index 56943d4e6678dcca25fa8a9f65a7518bcaf10bb2..ac7f620df423024364c979221819398de84f4585 100644 (file)
@@ -10,7 +10,7 @@ void my_unexpected() {
 template <class T> int foo(T) throw (T) { throw "Hi"; }
 
 main() {
-  set_unexpected (my_unexpected);
+  std::set_unexpected (my_unexpected);
   try {
     foo(1);
   } catch (int i) {
index 7e83aaf0c8b2085fe08141f9143167a1539d4482..e64bcf823745eccefe767c8bc9e87c1805943bb9 100644 (file)
@@ -12,7 +12,7 @@ void throw_an_unexpected_exception() throw() {
 }
 
 int main() {
-  set_terminate(my_terminate_handler);
+  std::set_terminate(my_terminate_handler);
   throw_an_unexpected_exception();
   return 1;
 }
index f0243ca41c5ad2dcbe9e6674fbe73837a4c861b6..77d31104f805c9524fd36d8117a40317ae5e3e1c 100644 (file)
@@ -1,4 +1,3 @@
-// excess errors test - XFAIL *-*-*
 class Foo {
 };
 
index d0eb3cd52444a518692ef760c0c448b877ac1263..5482a43c72f102d08336da57860da2fb6e707d57 100644 (file)
@@ -1,5 +1,4 @@
 // Build don't link:
-// excess errors test - XFAIL *-*-*
 
 namespace N {
   struct C {
index 62ac4566359b93ad28bf08c6f36e1ef9319df5c8..3c3ad3fc20ba9428a4384877af58ee3845dc29b9 100644 (file)
@@ -1,5 +1,4 @@
 // Build don't link:
-// excess errors test - XFAIL *-*-*
 
 namespace Jazz {
   int horn( int h ) { return 1; }
index b88ae278e39d19f66d0e30b7c3f0062c2fead21d..65798a7ba423039f77c9b75f27645c38057f9c5a 100644 (file)
@@ -1,4 +1,3 @@
-// excess errors test - XFAIL *-*-*
 namespace Foo {
   bar() {
     return 0;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/alias1.C b/gcc/testsuite/g++.old-deja/g++.ns/alias1.C
new file mode 100644 (file)
index 0000000..797e2b2
--- /dev/null
@@ -0,0 +1,18 @@
+namespace foo{
+ int eine_funktion(int)
+ {
+   return 0;
+ }
+}
+
+namespace foo{
+ void eine_funktion(int,int)
+ {}
+}
+
+namespace bar = foo;
+
+int main()
+{
+  return bar::eine_funktion(3);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/koenig1.C b/gcc/testsuite/g++.old-deja/g++.ns/koenig1.C
new file mode 100644 (file)
index 0000000..bd721fe
--- /dev/null
@@ -0,0 +1,18 @@
+// Build don't link:
+class ostream;
+extern ostream cout;
+namespace foo
+{
+  struct S
+  {
+    int i;
+  };
+  
+  extern ostream &operator<<(ostream &, const S &);
+}
+
+
+void bar(foo::S s)
+{
+  cout << s ;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/lookup1.C b/gcc/testsuite/g++.old-deja/g++.ns/lookup1.C
new file mode 100644 (file)
index 0000000..6b6f0cc
--- /dev/null
@@ -0,0 +1,3 @@
+// Build don't link: 
+typedef int __quad_t;
+typedef __quad_t __qaddr_t;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/lookup2.C b/gcc/testsuite/g++.old-deja/g++.ns/lookup2.C
new file mode 100644 (file)
index 0000000..0143290
--- /dev/null
@@ -0,0 +1,9 @@
+// Build don't link: 
+template <class charT>
+struct basic_string
+{
+  charT append (charT c)
+    { return c; }
+};
+typedef char c;
+template class basic_string <char>;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns1.C b/gcc/testsuite/g++.old-deja/g++.ns/ns1.C
new file mode 100644 (file)
index 0000000..7c4fd92
--- /dev/null
@@ -0,0 +1,16 @@
+namespace foo{
+  int eine_funktion(int)
+    {
+      return 0;
+    }
+
+  int eine_funktion(int,int)
+    {
+      return 1;
+    }
+}
+
+main(int,char**)
+{
+  return foo::eine_funktion(1);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns10.C b/gcc/testsuite/g++.old-deja/g++.ns/ns10.C
new file mode 100644 (file)
index 0000000..3eb70a8
--- /dev/null
@@ -0,0 +1,13 @@
+//Build don't link:
+namespace bb
+{
+  int f(int);
+
+  namespace k
+  {
+    void foo(int bar)
+    {
+      int i=bb:f(bar); // ERROR - namespace
+    }
+  }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns11.C b/gcc/testsuite/g++.old-deja/g++.ns/ns11.C
new file mode 100644 (file)
index 0000000..ffc5acb
--- /dev/null
@@ -0,0 +1,19 @@
+// Build don't link
+// Check [namespace.memdef]/2
+
+namespace A{
+  void f(int);
+  void f(int,int);
+  int i;              // ERROR - .*
+}
+
+void A::f(){}         // ERROR - should have been declared before
+
+namespace B{
+  void A::f(int){}    // ERROR - B does not surround A
+}
+
+int A::i;             // ERROR - redefinition
+
+void A::f(int,int){}  // ok
+
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns12.C b/gcc/testsuite/g++.old-deja/g++.ns/ns12.C
new file mode 100644 (file)
index 0000000..33d50b1
--- /dev/null
@@ -0,0 +1,22 @@
+namespace fred
+{
+  int barney();
+  extern int wilma;
+}
+
+int fred::barney()
+{
+  return fred::wilma;
+}
+
+int fred::wilma;
+
+int barney()
+{
+  return 1;
+}
+
+main()
+{
+  return fred::barney();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns2.C b/gcc/testsuite/g++.old-deja/g++.ns/ns2.C
new file mode 100644 (file)
index 0000000..dcef203
--- /dev/null
@@ -0,0 +1,26 @@
+namespace foo{
+ struct X{
+   int i;
+   void f();
+   static int k1,k2;
+ };
+ void X::f(){}
+ int var;
+ int X::k1;
+}
+
+using namespace foo;
+X zzz;
+int X::k2;
+
+void andere_funktion()
+{
+  zzz.f();
+  var=4;
+}
+
+main(int,char**)
+{
+  andere_funktion();
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns3.C b/gcc/testsuite/g++.old-deja/g++.ns/ns3.C
new file mode 100644 (file)
index 0000000..a1c8f53
--- /dev/null
@@ -0,0 +1,17 @@
+// Build don't link: 
+namespace foo{
+ void eine_funktion(int)
+ {}
+}
+
+using namespace foo;
+
+namespace foo{
+ void eine_funktion(int,int)
+ {}
+}
+
+void andere_funktion()
+{
+  eine_funktion(3,4);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns4.C b/gcc/testsuite/g++.old-deja/g++.ns/ns4.C
new file mode 100644 (file)
index 0000000..f720da3
--- /dev/null
@@ -0,0 +1,11 @@
+// Build don't link: 
+namespace A{
+  enum foo{a,b,c};
+}
+using A::foo;
+using A::b;
+void g()
+{
+  foo x;
+  x=b;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns5.C b/gcc/testsuite/g++.old-deja/g++.ns/ns5.C
new file mode 100644 (file)
index 0000000..f35b247
--- /dev/null
@@ -0,0 +1,6 @@
+// Build don't link: 
+namespace X{
+  class Y{};
+}
+
+X::Y z;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns6.C b/gcc/testsuite/g++.old-deja/g++.ns/ns6.C
new file mode 100644 (file)
index 0000000..0617b79
--- /dev/null
@@ -0,0 +1,13 @@
+namespace A{
+ int i;
+ namespace B{
+  void f(){i++;}
+  int i;
+  void g(){i++;}
+  }
+}
+
+main()
+{
+  return A::i-A::B::i;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns7.C b/gcc/testsuite/g++.old-deja/g++.ns/ns7.C
new file mode 100644 (file)
index 0000000..9afc97c
--- /dev/null
@@ -0,0 +1,26 @@
+// Build don't link: 
+namespace A{
+ struct X{
+   int i;
+   X(){}
+   X(int j);
+   void operator=(const X&);
+   virtual ~X(){}
+ };
+ void X::operator=(const X&o)
+ {
+   i=o.i;
+ }
+}
+
+A::X::X(int j):i(j){}
+
+namespace A{
+  struct Y:public X{
+    int j;
+    Y(int,int);
+  };
+}
+
+A::Y::Y(int a,int b):X(a),j(b)
+{}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns8.C b/gcc/testsuite/g++.old-deja/g++.ns/ns8.C
new file mode 100644 (file)
index 0000000..4d1ab40
--- /dev/null
@@ -0,0 +1,11 @@
+// Build don't link: 
+namespace B{
+ void f();
+}
+
+using namespace B;
+
+void g()
+{
+       ::f();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/ns9.C b/gcc/testsuite/g++.old-deja/g++.ns/ns9.C
new file mode 100644 (file)
index 0000000..a8803b8
--- /dev/null
@@ -0,0 +1,13 @@
+// Build don't link:
+namespace bb
+{
+  int f(int);
+
+  namespace k
+  {
+    void foo(int bar)
+    {
+      return bb:f(bar); //ERROR - syntax error
+    }
+  }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload1.C b/gcc/testsuite/g++.old-deja/g++.ns/overload1.C
new file mode 100644 (file)
index 0000000..6f6f3d4
--- /dev/null
@@ -0,0 +1,33 @@
+// Unqualified lookup should find all functions.
+// Duplicates are ignored as long as they lose during overload resolution.
+namespace A{
+  int f(){
+    return 1;
+  }
+  int f(double);
+}
+namespace B{
+  int f(int){
+    return 2;
+  }
+  int f(double);
+}
+
+int f(int,int)
+{
+  return 3;
+}
+
+using namespace A;
+using namespace B;
+
+main()
+{
+  if(f() != 1)
+    return 1;
+  if(f(1) != 2)
+    return 1;
+  if(f(0,0) != 3)
+    return 1;
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload2.C b/gcc/testsuite/g++.old-deja/g++.ns/overload2.C
new file mode 100644 (file)
index 0000000..500d780
--- /dev/null
@@ -0,0 +1,12 @@
+namespace A{
+  void f();   // ERROR - .*
+}
+
+using namespace A;
+
+void f();     // ERROR - .*
+
+void g()
+{
+  f();        // ERROR - ambiguous, ::f or A::f ?
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload3.C b/gcc/testsuite/g++.old-deja/g++.ns/overload3.C
new file mode 100644 (file)
index 0000000..945f948
--- /dev/null
@@ -0,0 +1,19 @@
+// Build don't link:
+// Declarations after the first one don't affect the set of used decls.
+
+namespace A{
+  void f();         // ERROR - .*
+}
+
+using A::f;
+
+namespace A{
+  void f(int);
+}
+
+using A::f;
+
+void g()
+{
+  f(4);            // ERROR - too many arguments
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload4.C b/gcc/testsuite/g++.old-deja/g++.ns/overload4.C
new file mode 100644 (file)
index 0000000..24d0ced
--- /dev/null
@@ -0,0 +1,8 @@
+// Build don't link:
+namespace A{
+  void f();   // ERROR - .*
+}
+
+using A::f;
+void f();     // ERROR - duplicate declaration
+
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/overload5.C b/gcc/testsuite/g++.old-deja/g++.ns/overload5.C
new file mode 100644 (file)
index 0000000..210f3b0
--- /dev/null
@@ -0,0 +1,14 @@
+// Build don't link:
+namespace A{
+  void f(){}         // ERROR - previous declaration
+}
+
+using A::f;
+
+void f(int);
+void f(){}            // ERROR - conflict
+
+void g()
+{
+  f(4);
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template1.C b/gcc/testsuite/g++.old-deja/g++.ns/template1.C
new file mode 100644 (file)
index 0000000..593df9e
--- /dev/null
@@ -0,0 +1,9 @@
+// Build don't link: 
+namespace foo {
+
+  template <class T>
+  class x {};
+
+}
+
+foo::x<int> y;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template2.C b/gcc/testsuite/g++.old-deja/g++.ns/template2.C
new file mode 100644 (file)
index 0000000..bb7c1dc
--- /dev/null
@@ -0,0 +1,14 @@
+//Build don't link:
+//Inheritance from templates which are namespace members
+namespace foo {
+
+  template <class T>
+  struct x {
+    x(){}
+  };
+
+}
+
+class y : public foo::x<int> {};
+
+y r;
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/using1.C b/gcc/testsuite/g++.old-deja/g++.ns/using1.C
new file mode 100644 (file)
index 0000000..489faac
--- /dev/null
@@ -0,0 +1,3 @@
+// Build don't link:
+using namespace bb; // ERROR - .*
+
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/using2.C b/gcc/testsuite/g++.old-deja/g++.ns/using2.C
new file mode 100644 (file)
index 0000000..879e0c5
--- /dev/null
@@ -0,0 +1,5 @@
+// Build don't link:
+void f();
+namespace A{
+  using ::f;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/temporary1.C b/gcc/testsuite/g++.old-deja/g++.other/temporary1.C
new file mode 100644 (file)
index 0000000..93cd709
--- /dev/null
@@ -0,0 +1,40 @@
+extern "C" int printf(char*, ...);
+
+int c, d;
+class Foo 
+{
+public:
+   Foo() { printf("Foo() 0x%08lx\n", (unsigned long)this); ++c; }
+   Foo(Foo const &) { printf("Foo(Foo const &) 0x%08lx\n", (unsigned long)this); }
+   ~Foo() { printf("~Foo() 0x%08lx\n", (unsigned long)this); ++d; }
+};
+
+// Bar creates constructs a temporary Foo() as a default
+class Bar 
+{
+public:
+   Bar(Foo const & = Foo()) { printf("Bar(Foo const &) 0x%08lx\n", (unsigned long)this); }
+};
+
+void fakeRef(Bar *)
+{
+}
+
+int main() 
+{
+   // Create array of Bar. Will use default argument on constructor.
+   // The old compiler will loop constructing Bar. Each loop will
+   // construct a temporary Foo() but will not destruct the Foo(). 
+   // The Foo() temporary is destructed only once after the loop 
+   // completes. This could lead to a memory leak if the constructor 
+   // of Foo() allocates memory.
+   Bar bar[2];
+
+   fakeRef(bar);
+
+   printf("Done\n");
+
+   if (c == d && c == 2)
+     return 0;
+   return 1;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/scope1.C b/gcc/testsuite/g++.old-deja/g++.pt/scope1.C
new file mode 100644 (file)
index 0000000..cfd9cdf
--- /dev/null
@@ -0,0 +1,13 @@
+// Build don't link:
+
+template<class X, class Z>
+class foo
+{
+public:
+  typedef X y;
+
+  class bar {
+  public:
+    void blah () { y Y; }
+  };
+};