3 // Copyright (C) 1999 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 5 Sep 1999 <nathan@acm.org>
6 // C++ does not decay lvalues into rvalues until as late as possible. This
7 // means things like the rhs of a comma operator mustn't decay. This will make
8 // a difference if it is an array or function.
12 extern S s; // an incomplete
13 extern S arys[20]; // an incomplete array
14 extern T aryt[]; // an incomplete array;
18 int main (int argc, char **argv)
20 sizeof (s); // ERROR - incomplete
21 sizeof (0, s); // ERROR - incomplete
22 sizeof (argc ? s : s); // ERROR - incomplete
24 sizeof (arys); // ERROR - incomplete
25 sizeof (0, arys); // ERROR - incomplete
26 sizeof (argc ? arys : arys); // ERROR - incomplete
28 sizeof (aryt); // ERROR - incomplete
29 sizeof (0, aryt); // ERROR - incomplete
30 sizeof (argc ? aryt : aryt); // ERROR - incomplete
32 sizeof (fn); // ERROR - cannot take size of function
33 sizeof (0, fn); // ERROR - cannot take size of function
34 sizeof (argc ? fn : fn); // ERROR - cannot take size of function
37 sizeof (0, &fn); // ok
38 sizeof (argc ? &fn : &fn); // ok