Update function overload resolution logic.
Closer compatibility with C++: given a non-reference type, treat matching to a non-const reference of that type as a better match than a const reference of that type (rather than both being equal cost). Issue #224.
This commit is contained in:
14
tests/func-overload-refs.ispc
Normal file
14
tests/func-overload-refs.ispc
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
export uniform int width() { return programCount; }
|
||||
|
||||
float foo(float &a) { return 1; }
|
||||
float foo(const float &a) { return 2; }
|
||||
|
||||
export void f_f(uniform float RET[], uniform float aFOO[]) {
|
||||
float x = 0;
|
||||
RET[programIndex] = foo(x);
|
||||
}
|
||||
|
||||
export void result(uniform float RET[]) {
|
||||
RET[programIndex] = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user