]> granicus.if.org Git - clang/commitdiff
PR7117: Make sure we don't lose the calling convention for K&R-style
authorEli Friedman <eli.friedman@gmail.com>
Mon, 17 May 2010 02:50:18 +0000 (02:50 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Mon, 17 May 2010 02:50:18 +0000 (02:50 +0000)
definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103932 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp
test/CodeGen/stdcall-fastcall.c

index 5a24a2c4c0a3721abcb6b81902cc27c0e65d41a4..b573e2dcc947d574ad0a269b2e0c4c62743ceab7 100644 (file)
@@ -1176,7 +1176,8 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S,
       QualType T = Func->getType();
       QualType NoProtoType = T;
       if (const FunctionProtoType *Proto = T->getAs<FunctionProtoType>())
-        NoProtoType = Context.getFunctionNoProtoType(Proto->getResultType());
+        NoProtoType = Context.getFunctionNoProtoType(Proto->getResultType(),
+                                                     Proto->getExtInfo());
       return BuildDeclRefExpr(Func, NoProtoType, NameLoc, &SS);
     }
   }
index bea6df39f965a25a998ae9c35c093caecd419711..46fe326fadfa6a753107de6ab5ed0545386c76d5 100644 (file)
@@ -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
+}