KhronosGroup / KhronosGroup/glslang

Code with unary plus is recognized as l-value

Open
#2,636 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.