public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings
@ 2015-10-14  6:23 chrisb2244 at gmail dot com
  2020-03-13 14:39 ` [Bug c++/67960] [8/9 Regression] " ppalka at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: chrisb2244 at gmail dot com @ 2015-10-14  6:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67960
           Summary: Prefixing a function with [[deprecated]] produces
                    multiple warnings
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chrisb2244 at gmail dot com
  Target Milestone: ---

The [[deprecated]] prefix for a function produces multiple warnings.

In v5.2.0, there are 3 warnings for the code

    [[deprecated]] void doNothing(){}
    int main(){
        doNothing();
    }

I am informed that in v4.9.2, only 2 warnings are emitted for the same code - 
http://stackoverflow.com/questions/33117030/when-using-deprecated-the-warning-is-given-3-times?noredirect=1#comment54048535_33117030

Replacing the body of main with

    auto f = doNothing;
    f();

reduces the output to 2 warnings in v5.2.0, and apparently 1 warning in 4.9.2


Bug 17729 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17729) seems to be
about a similar issue (the same issue?) but there discusses the attribute
rather than a tag - I assume the tag is implemented in terms of the attribute
but am unsure hence a new bug report.


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

* [Bug c++/67960] [8/9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
@ 2020-03-13 14:39 ` ppalka at gcc dot gnu.org
  2020-03-15 12:02 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-03-13 14:39 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |ASSIGNED
                 CC|                            |ppalka at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
      Known to fail|10.0                        |
            Summary|[8/9/10 Regression]         |[8/9 Regression] Prefixing
                   |Prefixing a function with   |a function with
                   |[[deprecated]] produces     |[[deprecated]] produces
                   |multiple warnings           |multiple warnings

--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
I have a patch.

--- Comment #8 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed on trunk by r10-7159.

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

* [Bug c++/67960] [8/9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
  2020-03-13 14:39 ` [Bug c++/67960] [8/9 Regression] " ppalka at gcc dot gnu.org
@ 2020-03-15 12:02 ` marxin at gcc dot gnu.org
  2020-03-20 17:56 ` egallager at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-15 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
commit r10-7159-g80a13af724aedfb360893dcc16aa7cc12ca49799
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Mar 12 14:38:42 2020 -0400

    c++: Redundant -Wdeprecated-declarations warning in build_over_call
[PR67960]

    In build_over_call, we are emitting a redundant -Wdeprecated-declarations
    warning about the deprecated callee function, first from mark_used and
again
    from build_addr_func <- decay_conversion <- cp_build_addr_expr <-
mark_used.

    It seems this second deprecation warning coming from build_addr_func will
always
    be redundant, so we can safely use a warning_sentinel to disable it before
    calling build_addr_func.  (And any deprecation warning that could come from
    build_addr_func would be for FN, so we wouldn't be suppressing too much.)

    gcc/cp/ChangeLog:

            PR c++/67960
            * call.c (build_over_call): Use a warning_sentinel to disable
            warn_deprecated_decl before calling build_addr_func.

    gcc/testsuite/ChangeLog:

            PR c++/67960
            * g++.dg/diagnostic/pr67960.C: New test.
            * g++.dg/diagnostic/pr67960-2.C: New test.

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

* [Bug c++/67960] [8/9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
  2020-03-13 14:39 ` [Bug c++/67960] [8/9 Regression] " ppalka at gcc dot gnu.org
  2020-03-15 12:02 ` marxin at gcc dot gnu.org
@ 2020-03-20 17:56 ` egallager at gcc dot gnu.org
  2020-03-24 14:49 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: egallager at gcc dot gnu.org @ 2020-03-20 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #10 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #8)
> Fixed on trunk by r10-7159.

so... keeping open for backports, I take it?

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

* [Bug c++/67960] [8/9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
                   ` (2 preceding siblings ...)
  2020-03-20 17:56 ` egallager at gcc dot gnu.org
@ 2020-03-24 14:49 ` ppalka at gcc dot gnu.org
  2021-05-14  9:47 ` [Bug c++/67960] [9 " jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ppalka at gcc dot gnu.org @ 2020-03-24 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #10)
> (In reply to Patrick Palka from comment #8)
> > Fixed on trunk by r10-7159.
> 
> so... keeping open for backports, I take it?

Probably yes.

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

* [Bug c++/67960] [9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
                   ` (3 preceding siblings ...)
  2020-03-24 14:49 ` ppalka at gcc dot gnu.org
@ 2021-05-14  9:47 ` jakub at gcc dot gnu.org
  2021-06-01  8:07 ` rguenth at gcc dot gnu.org
  2022-05-27  8:03 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug c++/67960] [9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
                   ` (4 preceding siblings ...)
  2021-05-14  9:47 ` [Bug c++/67960] [9 " jakub at gcc dot gnu.org
@ 2021-06-01  8:07 ` rguenth at gcc dot gnu.org
  2022-05-27  8:03 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug c++/67960] [9 Regression] Prefixing a function with [[deprecated]] produces multiple warnings
  2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
                   ` (5 preceding siblings ...)
  2021-06-01  8:07 ` rguenth at gcc dot gnu.org
@ 2022-05-27  8:03 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|9.5                         |10.0
             Status|ASSIGNED                    |RESOLVED
      Known to fail|                            |9.5.0

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 10.

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

end of thread, other threads:[~2022-05-27  8:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14  6:23 [Bug c++/67960] New: Prefixing a function with [[deprecated]] produces multiple warnings chrisb2244 at gmail dot com
2020-03-13 14:39 ` [Bug c++/67960] [8/9 Regression] " ppalka at gcc dot gnu.org
2020-03-15 12:02 ` marxin at gcc dot gnu.org
2020-03-20 17:56 ` egallager at gcc dot gnu.org
2020-03-24 14:49 ` ppalka at gcc dot gnu.org
2021-05-14  9:47 ` [Bug c++/67960] [9 " jakub at gcc dot gnu.org
2021-06-01  8:07 ` rguenth at gcc dot gnu.org
2022-05-27  8:03 ` rguenth 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).