https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122259

--- Comment #2 from Jonny Grant <jg at jguk dot org> ---
I appreciate this is the way the error messages are, and it's difficult to
change them. (Maybe there is even a design for them to be like this.) While I
understand "operand type" and "lhs" many users won't - maybe they could be left
out of the error messages? (as is the case with the C++ struct and C struct
example)

I understand g++ is trying to match match 'operator=', however, could it just
use the expression "assign"? I'd even simplify more:

```
<source>:12:14: error: cannot assign to read-only struct member 'a' with 'const
std::string'
   12 |     test.a = oops;
```

```
<source>:12:14: error: cannot assign 'std::string to read-only 'const
std::string' 
   12 |     test.a = oops;
```


Is it possible to leave most of STL messages out like Clang does?
Maybe an option to not show the templates that make up std::string (many users
won't need to see STL internals as we don't maintain them)
"{aka 'const std::__cxx11::basic_string<char>'}" seems unneeded.

Reply via email to