This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Automatized pattern matching
Hello,
> > (A twisted alternate idea: "auto TYPE foo;" at file scope is
> > currently a hard error, and I think a constraint violation; we could
> > make it mean 'implicitly declare this variable at function scope in
> > any function that uses it' as an extension.)
>
> If you want to use extensions, then statement expressions exist and should
> suffice.
This does not solve it -- the temporary variables as I use them are
also used outside of the macro (and it is quite useful, as you may then
express arbitrary additional conditions for the matched expressions).
You may always use your own named variables, but it is much less
convenient.
> But doesn't the code generated need to compile at all stages of
> bootstrap (so with any ISO C compiler)?
This would not be a problem; it would just require a macro that would
expand to static in the first stage and to auto in the remaining ones.
Zdenek