x
authorJason Merrill <jason@gcc.gnu.org>
Mon, 10 Aug 1998 13:55:04 +0000 (09:55 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 10 Aug 1998 13:55:04 +0000 (09:55 -0400)
From-SVN: r21655

gcc/testsuite/g++.old-deja/g++.other/init6.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/new.C
gcc/testsuite/g++.old-deja/g++.other/new2.C
gcc/testsuite/g++.old-deja/g++.robertl/eb15.C
gcc/testsuite/g++.old-deja/g++.robertl/eb2.C

diff --git a/gcc/testsuite/g++.old-deja/g++.other/init6.C b/gcc/testsuite/g++.old-deja/g++.other/init6.C
new file mode 100644 (file)
index 0000000..a684ae1
--- /dev/null
@@ -0,0 +1,12 @@
+// Test for default-initialization of POD-structs in functional cast notation.
+
+struct foo { int a[10]; };
+
+int main()
+{
+  foo f = foo();
+  int r = 0;
+  for (int i = 0; i < 10; ++i)
+    r |= f.a[i];
+  return r;
+}
index 829db70e868eca6dbf3556fe023d160ba03a2b85..e2839578d15d8d83c5f60733950273ef8c535bff 100644 (file)
@@ -1,6 +1,6 @@
 // Build don't link:
 
-typedef unsigned int size_t;
+typedef __SIZE_TYPE__ size_t;
 inline void *
 operator new(size_t alloc_sz, const char *fname, unsigned lineno)
 {
index 88cbe0ae0a1abb0485d789844c911af80001056d..9a6e0514ff45f0433aa004011ed54eb847ba764a 100644 (file)
@@ -1,5 +1,5 @@
 //Build don't link:
-typedef unsigned int size_t;
+typedef __SIZE_TYPE__ size_t;
 void *operator new(size_t, unsigned int);
 
 struct X{
index ef1576428e8b7970ec0ea16a1bf3e19b87887191..902d4631ac108e032d3e9435f8aea271c44b8972 100644 (file)
@@ -1,12 +1,13 @@
 // Build don't link:
 #include<iostream.h>
+#include<stddef.h>
 
 struct A {
   A() {
     cerr<<"A constructing\n";
     throw 1;
   }
-  void *operator new(unsigned sz) {
+  void *operator new(size_t sz) {
     cerr<<"A allocated\n";
     return ::operator new(sz);
   }
index a4b8e20c9ee94a8dd88df30c2f2e85deaf45faa3..b20002121a152a25ca34370d431d34ee818976ad 100644 (file)
@@ -1,5 +1,5 @@
 // Build don't link: 
-typedef unsigned int size_t;
+typedef __SIZE_TYPE__ size_t;
 inline void *operator new(size_t, void *place) throw() { return place; }
 
 struct A