yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
c4ed9500
main
1uniform int4 ui4 ; 2 3static const int cia = -4 ; 4static const int cib = -42 ; 5 6// ERROR: Ambiguous with fn1 below. 7// int4 fn1(int4 p0) { return int4(1,2,3,4); } 8 9int4 fn1 (int4 p0 ,bool b1 ,bool b2 = false) { 10return p0 ; 11} 12 13int4 fn1 (int4 p0 , 14int4 p1 :FOO = int4 (-1 ,-2 ,-3 ,cia ), 15int p2 [2 ] :BAR = {int (1 ),2 }, 16int p3 = abs (cib ) ) 17{ 18return p0 + p1 + p2 [0 ]+ p3 ; 19} 20 21// These should not be ambiguous if given either an int or a float explicit second parameter. 22int4 fn2 (int4 p0 ,int x = 3 ) 23{ 24return int4 (10 ,11 ,12 ,13 ); 25} 26 27int4 fn2 (int4 p0 ,float x = sin (3.3 ))// OK to have a const expression as a default value 28{ 29return p0 + int4 (20 ,21 ,22 ,23 ); 30} 31 32void fn3 (int p0 = 3 ) { } 33 34 35int4 main () :SV_Target0 36{ 37int myarray [2 ]= {30 ,31 }; 38 39fn3 (); 40fn3 (5 ); 41 42return fn1 (100 )+ 43fn1 (101 ,ui4 )+ 44fn1 (102 ,ui4 ,myarray )+ 45fn1 (103 ,ui4 ,myarray ,99 )+ 46fn1 (104 , false)+ 47fn1 (105 , false, true)+ 48 49fn2 (110 ,11.11 )+ // calls int4, float form 50fn2 (111 ,12 );// calls int4, int form 51}