Closed Bug 1936801 Opened 1 year ago Closed 1 year ago

Add workarounds for old Clang versions to Temporal

Categories

(Core :: JavaScript: Standard Library, task)

task

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

Attachments

(3 external files)

No description provided.

When compiling with "-std=c++17 -Wall -Werror", this code needs
extra braces in return {{0}} to avoid a warning in Clang < 13.

struct S1 {
  int value;
};

struct S2 : S1 {
  // Warning here when not using `{{0}}`.
  static S2 zero() { return {0}; }
};

S2 f() { return S2::zero(); }

The alternative is to set -Wno-missing-braces when Clang < 13, similar to
the already existing code which disables this warning for Clang < 6, cf.
"build/moz.configure/warnings.configure".

Both alternatives in && are evaluated early, so we have to use nested #if
directives.

Skip the static_assert for old Clang versions.

Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/563384bc356b Part 1: Add extra braces for Clang < 13. r=dminor https://hg.mozilla.org/integration/autoland/rev/907228031a15 Part 2: Restructure CWG2518 check for older Clang. r=dminor https://hg.mozilla.org/integration/autoland/rev/bd29334d06ee Part 3: Add a workaround if DR2126 is not implemented. r=dminor
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: