]> granicus.if.org Git - clang/commit
[MS] Treat ignored explicit calling conventions as an explicit __cdecl
authorReid Kleckner <rnk@google.com>
Tue, 9 Jul 2019 23:17:43 +0000 (23:17 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 9 Jul 2019 23:17:43 +0000 (23:17 +0000)
commit479475dc593b26ad9480b4c13a767d0d7a62ac30
tree409c9088aa6b206585097a2327fcf0aa9e6d6f5a
parent0a99e5c23db48ea1da8dc4ec6883c874f9ba5e62
[MS] Treat ignored explicit calling conventions as an explicit __cdecl

The CCCR_Ignore action is only used for Microsoft calling conventions,
mainly because MSVC does not warn when a calling convention would be
ignored by the current target. This behavior is actually somewhat
important, since windows.h uses WINAPI (which expands to __stdcall)
widely. This distinction didn't matter much before the introduction of
__vectorcall to x64 and the ability to make that the default calling
convention with /Gv. Now, we can't just ignore __stdcall for x64, we
have to treat it as an explicit __cdecl annotation.

Fixes PR42531

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365579 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDeclAttr.cpp
test/CodeGen/calling-conv-ignored.c [new file with mode: 0644]