[cfe-dev] FunctionDecls by typedef crash the C++ front-end
akyrtzi at gmail.com
Fri Oct 24 00:10:58 PDT 2008
Chris Lattner wrote:
> Two options here. The best is probably for the C++ front-end to
> create the parm var decls in this case, to be consistent with "void
> f(int);". The typedef shouldn't affect the AST generated other than
> the pretty type.
If the C++ front-end could be changed to handle the no-parmvardecl case,
it would also work in the case that not producing them is common.
In general I think there should be some convention, whether they are
produced or not should be the same for both front-ends. Producing them
for C++ and not for C is more confusing.
> Long term, I'd love to get rid of parm var decls in the common case.
> They are needed for stuff like this in C:
> void f(int i, int x[i*42]);
> etc. However, this is obviously not the common case, and most clients
> don't care about parmvardecls in function prototypes. Considering
> that tons of headers have lots of function prototypes, I think this
> would be a big win. This isn't a particularly high priority though,
More information about the cfe-dev