https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92181

Erich Erstu <hyena at hyena dot net.ee> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hyena at hyena dot net.ee

--- Comment #3 from Erich Erstu <hyena at hyena dot net.ee> ---
I started getting the same error after upgrading to GCC 9.3.0.

The problem in my case is either related to the use of std::pair in constexpr
or the fact that I have nested instances of std::initializer_list.

The workaround was to replace std::pair with a custom struct as seen here:

struct zone_name_root_variant_type {
    const char *name;
    std::initializer_list<ZONE_NAME_AFFIX> affixes;
};

struct zone_name_root_type {
    ZONE_NAME_ROOT index;
    const char *region;
    std::initializer_list<
        zone_name_root_variant_type
        /*
        std::pair<
            const char*,
            std::initializer_list<ZONE_NAME_AFFIX>
        >
        */
    > variants;
};

static constexpr const zone_name_root_type zone_name_root_table[] = {
    {
        ZONE_NAME_ROOT::UNKNOWN, "Region",
        {
            {  "",     { ZONE_NAME_AFFIX::UNKNOWN } }
        }
    },
    { ZONE_NAME_ROOT::NONE, "", { } }
};

Reply via email to