Open Bug 1791955 (Wenum-enum-conversion) Opened 2 years ago Updated 4 months ago

Fix and re-enable C++20 -Wenum-enum-conversion warnings

Categories

(Firefox Build System :: General, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: cpeterson, Unassigned)

References

(Blocks 1 open bug)

Details

C++20 deprecates some operations between unrelated enum types:

  enum A { ONE = 1 };
  enum B { TWO = 2 };
  ONE | TWO;  // warning: bitwise operation between different enumeration types ('A' and 'B') [-Wenum-enum-conversion]

https://clang.llvm.org/docs/DiagnosticsReference.html#wenum-enum-conversion

Alias: Wenum-enum-conversion

These -Wenum-enum-conversion warnings neither block nor depend on updating to C++20 because they were downgraded from errors to warnings in bug 1781001.

See Also: → 1781001

The meta keyword is there, the bug doesn't depend on other bugs and there is no activity for 12 months.
:ahochheiden, maybe it's time to close this bug?

Flags: needinfo?(ahochheiden)

I removed the meta keyword for now. This meta bug is a reminder that these C++20 warnings will exist when we eventually compile with -std=c++20.

Flags: needinfo?(ahochheiden)
Keywords: meta
Summary: [meta] Fix and re-enable C++20 -Wenum-enum-conversion warnings → Fix and re-enable C++20 -Wenum-enum-conversion warnings
Depends on: 1887580

C++20 introduced these -Wenum-enum-conversion warnings and C++26 made them errors:

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2864r2.pdf

Blocks: C++26
You need to log in before you can comment on or make changes to this bug.