public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106213] New: -Werror=deprecated-copy-dtor does not trigger warning and error
@ 2022-07-06  9:55 federico.kircheis at gmail dot com
  2022-07-06 20:41 ` [Bug c++/106213] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: federico.kircheis at gmail dot com @ 2022-07-06  9:55 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106213
           Summary: -Werror=deprecated-copy-dtor does not trigger warning
                    and error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: federico.kircheis at gmail dot com
  Target Milestone: ---

Consider

struct s{
    int* i;
    s();
    ~s(){ delete i;}
};


void bar(){
    s instance;
    s instance2 = instance;
}

This code compiles without warnings (gcc12) unless using
"-Wdeprecated-copy-dtor"

I would like it to be an error, so I've used "-Werror=deprecated-copy-dtor",
but
 * it does not trigger an error
 * it does not even trigger a warning(!!!)

The minimal example

https://godbolt.org/z/9b98Gsz1n

"-Werror -Wdeprecated-copy-dtor" works, but it might turn other warnings into
error, so it is not desirable.
Also the output of "-Werror -Wdeprecated-copy-dtor" mentions
"-Werror=deprecated-copy-dtor", so it should work.

A possible workaround is using "-Werror=deprecated-copy-dtor
-Wdeprecated-copy-dtor", but it should not be necessary.

Other flags, like Wreorder, works correclty: https://godbolt.org/z/zrr1GbK4K

As far as I've tested, "-Werror=deprecated-copy-dtor" never worked.

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

end of thread, other threads:[~2023-12-21 21:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  9:55 [Bug c++/106213] New: -Werror=deprecated-copy-dtor does not trigger warning and error federico.kircheis at gmail dot com
2022-07-06 20:41 ` [Bug c++/106213] " pinskia at gcc dot gnu.org
2022-07-06 20:42 ` pinskia at gcc dot gnu.org
2022-07-06 20:46 ` pinskia at gcc dot gnu.org
2023-12-19 20:42 ` jason at gcc dot gnu.org
2023-12-21  2:07 ` cvs-commit at gcc dot gnu.org
2023-12-21 21:59 ` jason 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).