C++20 designated initializer list requires CodecOverrides to be an aggregate type
Categories
(Core :: WebRTC, task, P3)
Tracking
()
| 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});
| ^~~~~~~~~~~~~~~~~~~~~~
| Assignee | ||
Comment 1•6 months ago
|
||
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).
Comment 3•6 months ago
|
||
| bugherder | ||
Updated•5 months ago
|
Description
•