public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107292] New: no warning for unused std::error_code
@ 2022-10-17 11:42 trass3r at gmail dot com
  2022-10-19 21:02 ` [Bug c++/107292] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: trass3r at gmail dot com @ 2022-10-17 11:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107292
           Summary: no warning for unused std::error_code
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trass3r at gmail dot com
  Target Milestone: ---

#include <system_error>
void foo()
{
    std::error_code ec;
}

The code does get optimized away as system_category() is [[gnu::const]] but
there is no -Wunused warning.

https://godbolt.org/z/M68ToY78b

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/107292] no warning for unused std::error_code
  2022-10-17 11:42 [Bug c++/107292] New: no warning for unused std::error_code trass3r at gmail dot com
@ 2022-10-19 21:02 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-19 21:02 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
this might require some new attributes to put on the constructor saying it will
not be used if the variable is not used for diagnostic reasons.
I don't think this can be done without any major changes like that really.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-19 21:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 11:42 [Bug c++/107292] New: no warning for unused std::error_code trass3r at gmail dot com
2022-10-19 21:02 ` [Bug c++/107292] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).