[cfe-dev] [LLVMdev] clang and overloaded functions

Chris Lattner clattner at apple.com
Wed Nov 26 10:51:48 PST 2008


On Nov 26, 2008, at 10:00 AM, Brian Watt wrote:
> In clang is it possible to declare C-language function prototypes  
> for overloaded functions even though it is not C-language legal.  
> It's because I see that GLSL provides something like this, and I'm  
> wondering if clang does too and how to express it either through  
> command line argument or language attributes, etc.?
>
> int f(int, int);
> float f(float, float);
> int g() {
>   float x = f(1.0f, 2.0f);
> }

Clang recently got support for overloading in C++, at least at the  
semantic  analysis level.  It doesn't do name mangling at codegen  
time, so I don't think code generation will work properly for  
overloading yet.  It is theoretically possible to extend this to C,  
but it would be better to just use C++ mode.

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20081126/1155e441/attachment.html>


More information about the cfe-dev mailing list