]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.c++/templates.cc
2001-03-06 J.T. Conklin <jtc@redback.com>
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.c++ / templates.cc
index 25241dc6dbff31b1598bb0d430e014ec949f89d4..c13f18b643fa09914c58173aba70eaf5c29a9924 100644 (file)
@@ -283,14 +283,14 @@ void h(long double = 4.33e33)
 { }
 #endif
 */
-void printf(const char *format, ... )
-{
-    // elipsis
-}
+
+/* An unneeded printf() definition - actually, just a stub - used to occupy
+   this space.  It has been removed and replaced with this comment which
+   exists to occupy some lines so that templates.exp won't need adjustment.  */
 
 class T1 {
 public:
-    static void* operator new(size_t);
+    static void* operator new(size_t) throw ();
     static void operator delete(void *pointer);
 
     void operator=(const T1&);
@@ -365,7 +365,7 @@ public:
 };
 
 void* 
-T1::operator new(size_t)
+T1::operator new(size_t) throw ()
 { return 0; }
 
 void
@@ -456,7 +456,7 @@ public:
     T5(int);
     T5(const T5<T>&);
     ~T5();
-    static void* operator new(size_t);
+    static void* operator new(size_t) throw ();
     static void operator delete(void *pointer);
     int value();
     
@@ -479,7 +479,7 @@ T5<T>::~T5()
 
 template<class T>
 void*
-T5<T>::operator new(size_t)
+T5<T>::operator new(size_t) throw ()
 { return 0; }
 
 template<class T>
@@ -516,14 +516,14 @@ public:
     int (*manage[5])(double,
                     void *(*malloc)(unsigned size),
                     void (*free)(void *pointer));
-    int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra = 0), 
+    int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra), 
                     int *(*read)(int fd, void *place, unsigned size),
                     int *(*write)(int fd, void *place, unsigned size),
                     void (*close)(int fd));
 };
 T5<x> t5x(5);
 
-#if !defined(__GNUC__) || (__GNUC__ >= 2 && __GNUC_MINOR__ >= 6)
+#if !defined(__GNUC__) || (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)
 template class T5<char>;
 template class T5<int>;
 template class T5<int (*)(char, void *)>;
@@ -714,9 +714,9 @@ int main()
 
     // New tests added here
 
-  Foo<int> fint;
-  Foo<char> fchar;
-  Foo<volatile char *> fvpchar;
+  Foo<int> fint={0,0};
+  Foo<char> fchar={0,0};
+  Foo<volatile char *> fvpchar = {0, 0};
 
   Bar<int, 33> bint;
   Bar<int, (4 > 3)> bint2;