[cfe-commits] [PATCH] Merge function types is C.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Nov 28 15:35:38 PST 2012


> I think I wasn't very clear here. My interpretation is: The type of the 'x'
> variable within the definition of 'f' is int(*)[]. That 'x' is not a
> redeclaration of the parameter in the previous 'f' declaration, so its type
> doesn't get merged, even though the type of the function does get merged.
>

OK, I have added the testcases from this thread and updated the
comment to not suggest patching the ParmVarDecl. Can you think of a
sema test that would capture us merging the function type and not just
the return type?

What is the behavior you would expect from CodeGen? Given

void f(int);
void f(a)
  char a;
{
  int v[sizeof(a) == 1 ? 1 : -1];
}

Should it produce a f(i32) that truncates its argument?

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 2283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121128/e71de724/attachment.obj>


More information about the cfe-commits mailing list