3 static const int cia = -4;
4 static const int cib = -42;
6 // ERROR: Ambiguous with fn1 below.
7 // int4 fn1(int4 p0) { return int4(1,2,3,4); }
9 int4 fn1(int4 p0, bool b1, bool b2 = false) {
14 int4 p1 : FOO = int4(-1,-2,-3, cia),
15 int p2[2] : BAR = { int(1), 2 },
18 return p0 + p1 + p2[0] + p3;
21 // These should not be ambiguous if given either an int or a float explicit second parameter.
22 int4 fn2(int4 p0, int x = 3)
24 return int4(10,11,12,13);
27 int4 fn2(int4 p0, float x = sin(3.3)) // OK to have a const expression as a default value
29 return p0 + int4(20,21,22,23);
32 void fn3(int p0 = 3) { }
35 int4 main() : SV_Target0
37 int myarray[2] = {30,31};
44 fn1(102, ui4, myarray) +
45 fn1(103, ui4, myarray, 99) +
47 fn1(105, false, true) +
49 fn2(110, 11.11) + // calls int4, float form
50 fn2(111, 12); // calls int4, int form