This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[GSoC] Function parameter scope
- From: Braden Obrzut <admin at maniacsvault dot net>
- To: gcc <gcc at gcc dot gnu dot org>
- Cc: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>, Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- Date: Sat, 17 May 2014 07:14:15 -0400
- Subject: [GSoC] Function parameter scope
- Authentication-results: sourceware.org; auth=none
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