llvm / llvm/llvm-project

[Clang] Improve the diagnostic for _Imag int/float LValue not assignable

Open
#222,383 2 comments 0 reactions 1 assignee Claimed by @AmrDeveloper View on GitHub
clang:diagnostics clang:frontend enhancement
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

After https://github.com/llvm/llvm-project/pull/218270, Clang will not crash but will report an error message.

```c++
_Complex float foo()
{
float f;
__real__ f = 0;
__imag__ f = 0; <--- errror: expression is not assignable
return f;
}
```

This issue is a follow-up task to improve the diagnostic message suggested in: https://github.com/llvm/llvm-project/pull/218270#pullrequestreview-5082973528

The current suggested error message is: `__imag operator with non-complex type is not assignable.`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.