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:
Matt Pharr
2012-04-03 10:40:41 -07:00
parent 4cd0cf1650
commit 391678a5b3
2 changed files with 67 additions and 16 deletions

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