sizeof3.C: New test.
authorNathan Sidwell <nathan@acm.org>
Wed, 8 Sep 1999 08:50:57 +0000 (08:50 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 8 Sep 1999 08:50:57 +0000 (08:50 +0000)
* g++.old-deja/g++.other/sizeof3.C: New test.
* g++.old-deja/g++.other/sizeof4.C: New test.
* g++.old-deja/g++.other/ambig2.C: Mark XFAILs.
* g++.old-deja/g++.other/lookup16.C: Mark XFAIL.

From-SVN: r29203

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/ambig2.C
gcc/testsuite/g++.old-deja/g++.other/lookup16.C
gcc/testsuite/g++.old-deja/g++.other/sizeof3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/sizeof4.C [new file with mode: 0644]

index f05eb74ba0d90e8dde03a6e8ea264786ca58dff9..ff307f8827f9357baf2cb8b56b40e953adf853a4 100644 (file)
@@ -1,3 +1,10 @@
+Wed Sep  8 09:39:56 BST 1999  Nathan Sidwell  <nathan@acm.org>
+
+       * g++.old-deja/g++.other/sizeof3.C: New test.
+       * g++.old-deja/g++.other/sizeof4.C: New test.
+       * g++.old-deja/g++.other/ambig2.C: Mark XFAILs.
+       * g++.old-deja/g++.other/lookup16.C: Mark XFAIL.
+
 1999-09-07  Richard Henderson  <rth@cygnus.com>
 
        * gcc.dg/va-arg-1.c: New.
index a8463ab909b485ec48555bd2fd4838fa9b759033..0966566ffcee2d28c3c6501f7bf2232c7d6df2cc 100644 (file)
@@ -14,7 +14,7 @@ struct D3 : B, C { int m; };
 
 void fn(D0 *d0, D1 *d1, D2 *d2, D3 *d3)
 {
-  A *a0 = d0;   // ERROR - A is an ambiguous base
+  A *a0 = d0;   // ERROR - A is an ambiguous base XFAIL
   A *a1 = d1;   // ERROR - A is an ambiguous base
   A *a2 = d2;   // ERROR - A is an ambiguous base
   A *a3 = d3;   // ERROR - A is an ambiguous base
index 9cf8404307c7b3c70c5546e09042cda33a736092..32fc477a6183843c105f9e7ad01e4aacacf50de5 100644 (file)
@@ -5,6 +5,8 @@
 // typenames are not injected early enough, [basic.scope.pdecl]3.3.1/4
 // indicates this should compile.
 
+// excess errors test - XFAIL
+
 struct A {
 };
 
@@ -24,7 +26,7 @@ struct C : B {
 
 struct D : B {
   typedef B Parent;
-  struct F : D::Parent::F {
+  struct F : D::Parent::F { // finds the wrong Parent
     typedef D::Parent::F Parent;
   };
 };
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof3.C
new file mode 100644 (file)
index 0000000..5ac2cc4
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// C++ does not decay lvalues into rvalues until as late as possible. This
+// means things like the rhs of a comma operator mustn't decay. This will make
+// a difference if it is an array or function.
+
+// execution test - XFAIL
+extern void abort();
+
+int main (int argc, char **argv)
+{
+  int ary[10];
+  int ary1[10];
+  
+  if (sizeof (0,ary) != sizeof (ary))
+    abort ();
+  if (sizeof (argc ? ary : ary1) != sizeof (ary))
+    abort ();
+  return 0;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C b/gcc/testsuite/g++.old-deja/g++.other/sizeof4.C
new file mode 100644 (file)
index 0000000..cb74e9a
--- /dev/null
@@ -0,0 +1,41 @@
+// Build don't link:
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
+
+// C++ does not decay lvalues into rvalues until as late as possible. This
+// means things like the rhs of a comma operator mustn't decay. This will make
+// a difference if it is an array or function.
+
+struct S;
+struct T {int m;};
+extern S s;  // an incomplete
+extern S arys[20];  // an incomplete array
+extern T aryt[];    // an incomplete array;
+
+void fn () {}
+
+int main (int argc, char **argv)
+{
+  sizeof (s);           // ERROR - incomplete
+  sizeof (0, s);        // ERROR - incomplete
+  sizeof (argc ? s : s); // ERROR - incomplete
+
+  sizeof (arys);        // ERROR - incomplete
+  sizeof (0, arys);     // ERROR - incomplete XFAIL
+  sizeof (argc ? arys : arys); // ERROR - incomplete
+
+  sizeof (aryt);        // ERROR - incomplete
+  sizeof (0, aryt);     // ERROR - incomplete XFAIL
+  sizeof (argc ? aryt : aryt); // ERROR - incomplete
+  
+  sizeof (fn);            // ERROR - cannot take size of function
+  sizeof (0, fn);         // ERROR - cannot take size of function XFAIL
+  sizeof (argc ? fn : fn); // ERROR - cannot take size of function
+  
+  sizeof (&fn);       // ok
+  sizeof (0, &fn);    // ok
+  sizeof (argc ? &fn : &fn); // ok
+  
+  return 0;
+}