Closed Bug 1991365 Opened 6 months ago Closed 6 months ago

C++20 designated initializer list requires CodecOverrides to be an aggregate type

Categories

(Core :: WebRTC, task, P3)

task

Tracking

()

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

Attachments

(1 file)

C++20 designated initializer list requires CodecOverrides to be an aggregate type.

In C++17, designated initializers like {.field = value} are not part of the standard, but some compilers (e.g. GCC, Clang) allowed them as an extension.

In C++20, designated initializers were standardized, but they only work for aggregate types (structs with no user-declared constructors, no base classes, no private/protected non-static data members).

/builds/worker/checkouts/gecko/media/webrtc/signaling/gtest/jsep_track_unittest.cpp:444:28: error: initialization of non-aggregate type 'CodecOverrides' with a designated initializer list
|   offerCodecs = MakeCodecs({.addDtmfCodec = true});
|                            ^~~~~~~~~~~~~~~~~~~~~~

In C++17, designated initializers like {.field = value} are not part of the standard, but some compilers (e.g. GCC, Clang) allowed them as an extension.

In C++20, designated initializers were standardized, but they only work for aggregate types (structs with no user-declared constructors, no base classes, no private/protected non-static data members).

Pushed by cpeterson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/367dc23e30e6 https://hg.mozilla.org/integration/autoland/rev/2bc9e018bb8e C++20 designated initializer list requires CodecOverrides to be an aggregate type. r=webrtc-reviewers,pehrsons
Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch
QA Whiteboard: [qa-triage-done-c146/b145]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: