[gnu.g++.bug] Bugs in GNU C++

tiemann@AI.MIT.EDU (Micheal Tiemann) (01/10/90)

   Date:    Dienstag,  9. Januar 1990, 14.33 Uhr und 13 Sekunden MEZ
   From: XITITKUN%DDATHD21.BITNET@mitvma.mit.edu
   X-Munix-To: bug-g++@prep.ai.mit.edu

   We are currently using the GNU C++ compiler version 1.34.2.
   While using the compiler I discovered the following two
   problems:

   1) The sample program ...

   an output like `SIZE: 4', but actually, the program doesn't
   compile at all.

   #include <stdio.h>

   main()
   {
     printf("SIZE: %d\n", sizeof(typeof(* typeof(int[3]) ) ) );
   }

   Starting the compiler with: bin/g++ demo.cc -o demo
   results in the following error message:
   In function int main ():
   demo.cc:5: parse error before `)'

Correct.  TYPEOF can only be used on expressions.  Since * typeof (...) 
yields a type, TYPEOF cannot again be applied.

   2) Initializing a struct parameter with a default value doesn't work,
   though I could find nothing in the documentation which tells me that
   this is not supposed to work. The following sample program

   #include <stdio.h>

   struct example
   { int a;
     float b;
   };

   void dummy(example demo ={5, 3.1415})
   { printf("Result: %d %f\n", demo.a, demo.b);
   }

   main()
   { example yyy;
     example xxx = {1, 1.0};
     dummy( yyy );
     dummy();
     dummy( xxx );
   }

This was a bug.  It is now fixed.

   Thomas Kunz  XITITKUN@DDATHD21.BITNET

Michael