<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><a href="http://clang.llvm.org/docs/LanguageExtensions.html#function-overloading-in-c">http://clang.llvm.org/docs/LanguageExtensions.html#function-overloading-in-c</a><div><br></div><div><div>#include <stdio.h></div><div>void __attribute__((overloadable)) onearg(int i) { printf("Arg is int: %d\n", i); }</div><div>void __attribute__((overloadable)) onearg(char *s) { printf("Arg is string: %s\n", s); }</div><div><br></div><div>int main() {</div><div>    onearg(1);</div><div>    onearg("String");</div><div>    return 0;</div><div>}</div><div><br></div><div><div>$ clang test.c && ./a.out</div><div>Arg is int: 1</div><div>Arg is string: String</div></div><div><br></div><div><div>On 14/06/2013, at 4:12 AM, Alireza Moshtaghi <<a href="mailto:Alireza.Moshtaghi@synopsys.com">Alireza.Moshtaghi@synopsys.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Hi,<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I’m trying to implement an overloading behavior to some of our builtin functions, and came across the following comment in SemaExpr.cpp<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">// Check for overloaded calls. This can happen even in C due to extensions.<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">If (Fn->getType() == Context.OverloadTy) { ….<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">I was wondering which C extensions is this referring to?<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Thanks<o:p></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; ">Ali<o:p></o:p></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu/" style="color: purple; text-decoration: underline; ">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color: purple; text-decoration: underline; ">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></body></html>