glslang
glslang copied to clipboard
Code with unary plus is recognized as l-value
The following code with a (useless) unary plus is validated by glslangvalidator while it should raise an error for the assignment to a non-lvalue.
It correctly raise an error for the unary minus.
#version 320 es
void main() {
int var1 = 5;
int var2 = + var1 += 3;
}
If someone wishes to submit a fix, please make a note on this issue to avoid duplicate effort.
I am guessing that the + is removed to simplify downstream checking where the + is superfluous. So the trick will be to catch this error without breaking analysis downstream.