[cfe-dev] Fwd: external function codegen bug

Eli Friedman eli.friedman at gmail.com
Fri May 23 04:15:39 PDT 2008


On Fri, May 23, 2008 at 2:37 AM, Csaba Hruska <csaba.hruska at gmail.com> wrote:
> buggy code:
>
> extern double g ();
> void f()
> {
>  double t, g();
>  t = g();
> }

I'm pretty sure it's an issue with merging function decls.  The issue
is that t essentially disappears from the AST (try running this code
through -ast-dump to see what I mean), so CodeGen ends up seeing a
reference to an undeclared variable.  Declaration merging and whatnot
is tricky code that I never really studied closely, though, so it's
not obvious why this is happening.

-Eli



More information about the cfe-dev mailing list