Commit 661d2b52 by Nathan Sidwell Committed by Nathan Sidwell

sizeof3.C: New test.

	* 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
parent a27995df
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.
......
......@@ -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
......
......@@ -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;
};
};
// 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;
}
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment