public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98543] New: fails to diagnose unnecessary functions
@ 2021-01-05 18:29 tiagomacarios at gmail dot com
  2021-01-07 14:27 ` [Bug c++/98543] " redi at gcc dot gnu.org
  2024-04-05 22:45 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: tiagomacarios at gmail dot com @ 2021-01-05 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98543
           Summary: fails to diagnose unnecessary functions
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tiagomacarios at gmail dot com
  Target Milestone: ---

clang diagnoses unnecessary functions, gcc fails to:

https://godbolt.org/z/vvErGh

static void f()
{
   [[maybe_unused]] auto var = &f;
}

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

* [Bug c++/98543] fails to diagnose unnecessary functions
  2021-01-05 18:29 [Bug c++/98543] New: fails to diagnose unnecessary functions tiagomacarios at gmail dot com
@ 2021-01-07 14:27 ` redi at gcc dot gnu.org
  2024-04-05 22:45 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2021-01-07 14:27 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-01-07
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
-Wunused-function fails to diagnose it because the address is taken. But the
address doesn't escape that function.

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

* [Bug c++/98543] fails to diagnose unnecessary functions
  2021-01-05 18:29 [Bug c++/98543] New: fails to diagnose unnecessary functions tiagomacarios at gmail dot com
  2021-01-07 14:27 ` [Bug c++/98543] " redi at gcc dot gnu.org
@ 2024-04-05 22:45 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-05 22:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-01-07 00:00:00         |2024-4-5

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note clang's warning here is not with -Wunused either but with a different
option (and has been that way since at least clang 3.0):
```
<source>:2:13: warning: function 'f' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
    2 | static void f()
      |             ^
```

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

end of thread, other threads:[~2024-04-05 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 18:29 [Bug c++/98543] New: fails to diagnose unnecessary functions tiagomacarios at gmail dot com
2021-01-07 14:27 ` [Bug c++/98543] " redi at gcc dot gnu.org
2024-04-05 22:45 ` 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).