Topic: Grammar error?


Author: "C. Grant" <camg100@hermes.cam.ac.uk>
Date: 1998/01/09
Raw View
I think I have found an error in the draft-2 grammar, that prevents
member functions from being called in expressions.

In [gram.expr]

postfix-expression:
 [snip]
 postfix-expression ( expression-listopt )                (*)
 [snip]
 postfix-expression . templateopt ::opt id-expression     (**)
 [snip]

(*) allows functions to be called, and (**) allows members to be access.
However (**) does not allow member functions to be called.

Adding the following rules do work though:

postfix-expression:
 postfix-expression . templateopt ::opt id-expression
     ( expression-listopt )
        postfix-expression -> templateopt ::opt id-expression
            ( expression-listopt )

Am I right ?

-- Calum




[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]