public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97573] New: Implement C++20 [depr.arith.conv.enum]
@ 2020-10-25 20:17 mpolacek at gcc dot gnu.org
  2020-10-25 20:17 ` [Bug c++/97573] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-10-25 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97573
           Summary: Implement C++20 [depr.arith.conv.enum]
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

P1120R0 added various deprecations, see [depr.arith.conv.enum]:

enum E1 { e };
enum E2 { f };
bool b = e <= 3.7;              // deprecated
int k = f - e;                  // deprecated

but we don't warn for this, not even with -Wdeprecated -Wenum-compare
-Wfloat-conversion -Wfloat-equal -Wpedantic -Wall -Wextra etc.

In C++20, this should warn by default.

-Wenum-conversion is currently only valid for C, but that should change, so
that we can warn on the code above in C++17 too.

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

end of thread, other threads:[~2021-10-04 16:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-25 20:17 [Bug c++/97573] New: Implement C++20 [depr.arith.conv.enum] mpolacek at gcc dot gnu.org
2020-10-25 20:17 ` [Bug c++/97573] " mpolacek at gcc dot gnu.org
2020-10-25 20:25 ` mpolacek at gcc dot gnu.org
2020-10-28 21:44 ` cvs-commit at gcc dot gnu.org
2021-10-04 16:34 ` cvs-commit at gcc dot gnu.org
2021-10-04 16:35 ` mpolacek 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).