Default argument promotion should promote functions/arrays

Testcase:
int a();
int b() {
a("asdf");
}

Run clang -ast-dump to see the issue.

Patch attached.

-Eli

unnamedargpromotionfix.txt (582 Bytes)

Testcase:
int a();
int b() {
a("asdf");
}

Run clang -ast-dump to see the issue.

Patch attached.

Eli,

The AST dumps look identical (see below).

What am I missing?

snaroff

[snaroff:llvm/tools/clang] snarofflocal% ../../Debug/bin/clang -ast-dump eli.c
typedef char *__builtin_va_list;

int a();

int b()
(CompoundStmt 0x906350 <eli.c:3:9, line:5:1>
   (CallExpr 0x9062f0 <line:4:1, col:9> 'int'
     (ImplicitCastExpr 0x906340 <col:1> 'int (*)()'
       (DeclRefExpr 0x9062b0 <col:1> 'int ()' FunctionDecl='a' 0x9025e0))
     (StringLiteral 0x9062d0 <col:3> 'char *' "asdf")))

[snaroff:llvm/tools/clang] snarofflocal% cp /var/folders/IN/IN1spQWVEDm8jU4ww+SauE+++TI/-Tmp-/com.apple.mail.drag-T0x7124b0.tmp.OTiSyY/unnamedargpromotionfix.txt .
[snaroff:llvm/tools/clang] snarofflocal% patch -p0 < unnamedargpromotionfix.txt
patching file Sema/SemaExpr.cpp
[snaroff:llvm/tools/clang] snarofflocal% make
make[1]: Nothing to be done for `all'.
llvm[1]: Compiling SemaExpr.cpp for Debug build
llvm[1]: Building Debug Archive Library libclangSEMA.a
make[1]: Nothing to be done for `all'.
llvm[1]: Linking Debug executable clang
llvm[1]: ======= Finished Linking Debug Executable clang
[snaroff:llvm/tools/clang] snarofflocal% ../../Debug/bin/clang -ast-dump eli.c typedef char *__builtin_va_list;

int a();

int b()
(CompoundStmt 0x906350 <eli.c:3:9, line:5:1>
   (CallExpr 0x9062f0 <line:4:1, col:9> 'int'
     (ImplicitCastExpr 0x906340 <col:1> 'int (*)()'
       (DeclRefExpr 0x9062b0 <col:1> 'int ()' FunctionDecl='a' 0x9025e0))
     (StringLiteral 0x9062d0 <col:3> 'char *' "asdf")))

[snaroff:llvm/tools/clang] snarofflocal%

You're not missing anything... I forgot that I have my string patch in my tree.

Try something like this:
int a();
int b() {
a(a);
}

-Eli