This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

possible parser bug?


I have a problem with the egcs parser. 
It raises an error message on code that seems syntactically correct to me.
It seems the egcs parser knows, it is inside a constructor parameter list. 
In a function call parameter list there is no parse error.

the code:

class A
{
  public:
    A() {};
    int f() { return 1; };
};

class B
{
  public:
    B(int) {};
};
    
A* GetA() { return new A(); };

int main()
{
  B(GetA()->f());
}

the error message:

test1.cxx: In function `int main()':
test1.cxx:18: parse error before `->'

egcs-1.0.3, egcs-1.1 and egcs-ss981101 show the same behaviour.

mike




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]