Skip to content

initializer_list behaviour change? #535

@yurii-shkrobut

Description

@yurii-shkrobut

Channel

It's idea for C++ Weekly episode

Topics

Why same code, works differently between clang-18 and clang(trunk)?

Example: https://godbolt.org/z/PrfTj8voW

Sample of code:

struct Sample {
    nlohmann::json obj{nlohmann::json::object()};
};

On clang-18: obj property is set as object; - {}
On clang(trunk) and gcc: obj property is set as array of objects; - [{}]

Length

5 minutes.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions