Closed Bug 1762933 Opened 8 months ago Closed 8 months ago

Fix compiler errors on C++20

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox100 --- wontfix
firefox101 --- fixed

People

(Reporter: anba, Assigned: anba)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Three issues currently prevent compiling to C++20:

  1. The static_cast in DECLARE_ONE_BOOL_OPERATOR can generate casts between incompatible types.
  • This can be fixed by only using static_cast for integral types.
  1. Deprecated arithmetic conversion on enumerations.
  1. Deprecated implicit this capture.

Otherwise we can for example end up with generating static_cast between const and non-const pointers.

Use std::underlying_type_t to convert from an enum to its underlying type.

Depends on D142855

Implicit this capture through = is deprecated in C++20.

Depends on D142856

Pushed by andre.bargull@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/14e582a97f5f
Part 1: Avoid static_cast on non-integral types. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/b1a9775198ab
Part 2: Fix implicit coercion between different enum types. r=tcampbell
https://hg.mozilla.org/integration/autoland/rev/a9a3140427ea
Part 3: Fix implicit this-capture in lambdas. r=tcampbell

(In reply to André Bargull [:anba] [back from break; working through mail backlog] from comment #0)

  • This also affects the ARM64 simulator, but any updates there should happen in the main repository first.

FWIW, the chances of us ever pulling another VIXL version (with the simulator) are very small; for several years we've been hacking freely on our local copy.

Blocks: sm-meta
Severity: -- → S3
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
Blocks: C++20
You need to log in before you can comment on or make changes to this bug.