operator* sema bug

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

I have a look later today…

Glad to hear you are feeling better!

snaroff

Commit 45148 fixes the bug below.

Thanks for the report (Oliver),

snaroff

Thanks!

By the way, it was my report. :slight_smile:

Indeed it was -- I had merely pinged Chris for his input on fixing it ... and then Steve fixed it (not that i'm complaining about it being fixed)

--Oliver