Add missing check that a function call is not using the same name as a variable hiding the function's name. Also, support version 110 separate name spaces for functions and variable names.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24480 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -16,6 +16,9 @@ int f(int a, int b, int c); // okay to redeclare
|
||||
bool b;
|
||||
float b(int a); // ERROR: redefinition
|
||||
|
||||
float c(int a);
|
||||
bool c; // ERROR: redefinition
|
||||
|
||||
float f; // ERROR: redefinition
|
||||
float tan; // okay, built-in is in an outer scope
|
||||
float sin(float x); // ERROR: can't redefine built-in functions
|
||||
@@ -37,7 +40,7 @@ void main()
|
||||
|
||||
float sin; // okay
|
||||
sin;
|
||||
|
||||
sin(0.7); // ERROR, use of hidden function
|
||||
f(1,2,3);
|
||||
|
||||
float f; // hides f()
|
||||
@@ -65,6 +68,9 @@ void main()
|
||||
S S = S(0); // 'S' is only visible as a struct and constructor
|
||||
S.x; // 'S' is now visible as a variable
|
||||
}
|
||||
|
||||
int degrees;
|
||||
degrees(3.2); // ERROR, use of hidden built-in function
|
||||
}
|
||||
|
||||
varying struct SSS { float f; } s; // ERROR
|
||||
|
||||
Reference in New Issue
Block a user