quakeforge/tools/qfcc/test/overload.r
Bill Currie b6ea47dca6 [qfcc] Add failing function overload test
This is a bit of a weird one because it's a combination of the aliasing
code and mixing C prototypes with QuakeC function definitions, and the
function type rebuilding in qc-parse.y not being very "consistent" in
its abuse of the type system.
2020-03-28 18:58:08 +09:00

23 lines
307 B
R

typedef enum {
NO = 0,
YES
} BOOL;
@extern BOOL sel_is_mapped (SEL aSel);
BOOL (SEL aSel) sel_is_mapped = #0;
@overload int foo(int x)
{
return 1;
}
@overload int foo(float x)
{
return 2;
}
int main()
{
//FIXME fails on implicit cast of double to float
return !(foo(5) == 1 && foo (5.0f) == 2);
}