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]
Other format: [Raw text]

[GSoC] Function parameter scope


Hello,

I'm trying to figure out how to bring variables into scope
temporarily.  The issue we're having is parsing something like:

auto f1(auto x) requires MyConcept<decltype(x)>() { }

This is similar to the late return type code, but we want to parse
this during cp_parser_init_declarator instead of during
cp_parser_direct_declarator.  The problem is that direct_declarator
closes the scope of the function arguments (as it should) so we get an
error about
x not being in scope.

I think the easiest solution would be to simply re-enter the scope
stored in declarator->u.function.parameters, but from what I can tell
this isn't just a matter of calling push_scope and pop_scope?

- Braden Obrzut


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