2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / sizeof3.C
blobb3f74db6822996ce375f5910f0f04ca8615255cd
1 // { dg-do run  }
2 // Copyright (C) 1999 Free Software Foundation, Inc.
3 // Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
5 // C++ does not decay lvalues into rvalues until as late as possible. This
6 // means things like the rhs of a comma operator mustn't decay. This will make
7 // a difference if it is an array or function.
9 extern void abort();
11 int main (int argc, char **argv)
13   int ary[10];
14   int ary1[10];
15   
16   if (sizeof (0,ary) != sizeof (ary))
17     abort ();
18   if (sizeof (argc ? ary : ary1) != sizeof (ary))
19     abort ();
20   return 0;