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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:9f10b4957ca6058d1a801c5e4bfe11bf159da809

commit r13-7149-g9f10b4957ca6058d1a801c5e4bfe11bf159da809
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Wed Apr 12 11:55:24 2023 +0100

    libstdc++: Initialize all members of basic_endpoint union [PR109482]

    On Solaris the in_addr struct contains a union and value-initializing it
    does not make the s_addr member active. This means we can't access that
    member later during constant evaluation.

    Make the constructors explicitly set every member that we might want to
    read later in constexpr member functions. This means even the default
    constructor can only be constexpr for C++20, because we can't change the
    active member of a union in older standards.

    libstdc++-v3/ChangeLog:

            PR libstdc++/109482
            * include/experimental/internet (basic_endpoint::basic_endpoint()):
            Ensure that the required union members are active. Only define
            as constexpr for C++20 and later.
            (basic_endpoint::basic_endpoint(const protocol_type&, port_type)):
            Likewise.
            * testsuite/experimental/net/internet/endpoint/cons.cc: Only
            check constexpr default constructor for C++20 and later.
            * testsuite/experimental/net/internet/endpoint/extensible.cc:
            Likewise.

Reply via email to