[Prev][Next][Index]

another forward ref problem




Dennis's mail suggests you might know about this one, but I'll report it
anyway. The pc++ parser barfs on the following code (accepted by gcc and
Sunpro CC):

	class bar {
	public:
	  static struct s *g();
	};
	
	class foo {
	public:
	  static f( int x, int b );
	};
	
	struct s { int a; };
	
	int main()
	{
	  foo::f( 1, (bar::g()->a) );
	  return 0;
	}

with the error message

	blackrabbit(19) % pc++ bug3.pc
	Error on line 13 of bug3.pc:  struct/union type definition have not appeared
	Error in pc++ while executing:
	------->  pC++2dep  TEMP_pC++.C

(where line 13 is the first line in the body of main()) but accepts it if
the definition of s is moved above the first reference.

The things you find in other people's code.

--lars