Hi Oliver,
Sorry for the delay, I’ve been majorly sick since thursday night. I don’t think this is a codegen bug, I think it’s a sema bug:
$ clang t3.c -ast-dump
typedef char *__builtin_va_list;
typedef struct entry;
char f1(entry e)
(CompoundStmt 0x8061e0 <t3.c:2:19, col:38>
(ReturnStmt 0x8061d0 <col:21, col:32>
(UnaryOperator 0x8061b0 <col:28, col:32> ‘char’ prefix '’
(MemberExpr 0x806180 <col:29, col:32> ‘char [100]’ ->name 0x805f00
(DeclRefExpr 0x806160 col:29 ‘entry *’ ParmVar=‘e’ 0x806120)))))
Sema is properly inferring that the * has type char, but it isn’t inserting an implicit cast. I’d expect to see something like this:
clang t3.c -ast-dump
typedef char *__builtin_va_list;
typedef struct entry;
char f1(entry e)
(CompoundStmt 0x8061e0 <t3.c:2:19, col:38>
(ReturnStmt 0x8061d0 <col:21, col:32>
(UnaryOperator 0x8061b0 <col:28, col:32> ‘char’ prefix '’
(ImplicitCast char*
(MemberExpr 0x806180 <col:29, col:32> ‘char [100]’ ->name 0x805f00
(DeclRefExpr 0x806160 col:29 ‘entry *’ ParmVar=‘e’ 0x806120))))))
Maybe Steve can take a look if he has a chance,
-Chris