<div dir="ltr"><div style>Hi John, Joćo!</div><div><br></div><div style>This patch adds a diagnostic if the following declarations have illegal calling conventions:</div><div style>* pointer to function, reference to function, pointer to member function variable (or function attribute) declaration;</div>

<div style>* function declaration;</div><div style>* typedef declaration.</div><div style><br></div><div style>It was proposed in PR13457 discussion (<a href="http://llvm.org/bugs/show_bug.cgi?id=13457#c22">http://llvm.org/bugs/show_bug.cgi?id=13457#c22</a>).</div>

<div><br></div>We already have such error for variadic functions declared with CC_X86Fastcall that is emitted from SemaType.  But microsoft ABI has different allowed CCs depending on whether it is a member function and it can't be determined given FunctionType only (AFAIK, standard doesn't differentiate between free function and member function types).  So this checking has to be done on declarations.<div>

<br></div><div style>With this patch, allowed calling conventions are ABI-specific. Therefore if we teach affected ABIs to disallow fastcall on variadic functions, we can remove the previous diagnostic.</div><div style><br>

</div><div style>Please review!</div><div style><br></div><div style>--</div><div style>Alex</div></div>