clang and overloaded functions

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);
}

Brian Watt, IBM

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.?

Hi Brian,

I’m redirecting this to the cfe-dev mailing list, which is where most clang discussions happen. I’ll follow up there,

-Chris

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

Oops, sorry, thanks Chris.

Brian Watt, IBM

> 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.?
>
> Hi Brian,
>
> I'm redirecting this to the cfe-dev mailing list, which is where
> most clang discussions happen. I'll follow up there,
>
> -Chris
>
>
>
> int f(int, int);
> float f(float, float);
> int g() {
> float x = f(1.0f, 2.0f);
> }
>
> Brian Watt, IBM_______________________________________________
> LLVM Developers mailing list
> LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev