[PATCH c++] Fix pr22138

Pearly Zhao pearly.zhao@oracle.com
Thu Jun 10 15:02:00 GMT 2010


----- gdr@integrable-solutions.net wrote:

>
> On Thu, Jun 10, 2010 at 4:41 AM, Manuel López-Ibáñez
> <lopezibanez@gmail.com> wrote:
> > On 10 June 2010 11:34, Paolo Carlini <paolo.carlini@oracle.com>
> wrote:
> >> On 06/10/2010 10:26 AM, Shujing Zhao wrote:
> >>>>
> >>>> Also why don't you use the function at_function_scope_p() to
> test
> >>>> whether you are at local scope?
> >>> The parser itself know whether or not it is in the body of a
> function.
> >>> The in_funtion_body is also more efficient that calling
> >>> at_function_scope_p. I think using parser->in_function_body is
> better
> >>> than at_function_scope_p.
> >> As a matter of fact, in the entire parser.c there are no uses of
> >> at_function_scope_p, and ~20 of in_function_body. Was curious...
> ;)
> >
> > It would be nice to add a comment to at_function_scope_p() or
> prevent
> > somehow to use it in the parser, so no one uses inadvertently.
> Perhaps
> > moving it to semantics.h. You know, modularization. Moreover, that
> > function should probably be inline. Although perhaps this does not
> > matter with LTO available.
> >
>  agreed.

How about the at_class_scope_p and at_namespace_scope_p? Should they be moved to semantics.c too?
Can this issue be fixed at a seperate patch? I think it's better to fix the pr22138 firstly, is the last patch ok?
I would volunteer to do the at_*_scope_p issue if no one do it.

Thanks
Pearly



More information about the Gcc-patches mailing list