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

Andrzej Krzemienski <akrzemi1 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |akrzemi1 at gmail dot com

--- Comment #29 from Andrzej Krzemienski <akrzemi1 at gmail dot com> ---
Note that the discussed problem only applies to
`__attribute__((warn_unused_result))` and `[[gnu::warn_unused_result]]`. Since
version 7, GCC also implements `[[nodiscard]]` which works as recommended by
the C++ Standard:

```
[[nodiscard]] int f () { return 1; }

int main()
{
  f();       // warns
  (void)f(); // doesn't warn
}
```

Reply via email to