[comp.lang.c++] func ptr bug

djones@megatest.UUCP (Dave Jones) (12/24/87)

/*

I have found a bug in the ATT C++ compiler, release 1.2.1.
There is a getaround.

Point of order:  Who do I report bugs to?  I have the sources, so
if I fix a bug, how can I submit the fix for inclusion in subsequent releases?

Now then, without further ado, heeeere's the BUG!  You can't declare
a pointer to a function inside a function.  It says, "syntax error".

The getaround is to use a typedef.

*/

typedef int (*fptr)(char*);

struct foozle
{ int (*foo)(char*); };  // okay 

int (*foo)(char*);       // okay 

main()
{
  fptr foozle;           // okay 
  int (*foo)(char*);     // syntax error
  {int (*foo)(char*);}   // syntax error 
}