From: Eli Friedman Date: Mon, 17 May 2010 02:50:18 +0000 (+0000) Subject: PR7117: Make sure we don't lose the calling convention for K&R-style X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a0fcfe659b65e1e1bba4ba5f35a12ffcd088ea0;p=clang PR7117: Make sure we don't lose the calling convention for K&R-style definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103932 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 5a24a2c4c0..b573e2dcc9 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1176,7 +1176,8 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S, QualType T = Func->getType(); QualType NoProtoType = T; if (const FunctionProtoType *Proto = T->getAs()) - NoProtoType = Context.getFunctionNoProtoType(Proto->getResultType()); + NoProtoType = Context.getFunctionNoProtoType(Proto->getResultType(), + Proto->getExtInfo()); return BuildDeclRefExpr(Func, NoProtoType, NameLoc, &SS); } } diff --git a/test/CodeGen/stdcall-fastcall.c b/test/CodeGen/stdcall-fastcall.c index bea6df39f9..46fe326fad 100644 --- a/test/CodeGen/stdcall-fastcall.c +++ b/test/CodeGen/stdcall-fastcall.c @@ -31,3 +31,9 @@ int main(void) { return 0; } +// PR7117 +void __attribute((stdcall)) f5(foo) int foo; {} +void f6(void) { + f5(0); + // CHECK: call x86_stdcallcc void (...)* bitcast +}