KhronosGroup / KhronosGroup/glslang
Code with unary plus is recognized as l-value
Open
bug
GLSL/ESSL
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
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;
}
```
Contributor guide
Research direction
Start by reproducing the example with glslangvalidator and compare its handling of unary plus with the unary-minus case described in the issue. The work is done when the unary-plus assignment to a non-lvalue is rejected as invalid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100