[Prev][Next][Index]
Re: another forward ref problem
- From: Beata Winnicka <bfatyga@slab.extreme.indiana.edu>
- Date: Thu, 27 Apr 95 14:55:15 -0500
- To: Lars Thomas Hansen <lth@cs.uoregon.edu>
- Subject: Re: another forward ref problem
- Cc: sage-bugs@rainier.extreme.indiana.edu
- Sender: owner-sage-bugs@extreme.indiana.edu
>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;
> }
I haven't been able to find an easy way to fix this. The problem is
that the parser generates two symbol table entries for struct s: one
has the scope of class bar, the other has the global scope. I don't
know how to change this behavior without breaking lots of other
stuff. --Beata