Skip to content

stdexec::env brace-initializer with a single argument fails for clang #1606

@romintomasetti

Description

@romintomasetti

I don't have time to trace back this compiler failure but here is a Godbolt reproducer.

Basically, the code is:

#include "stdexec/execution.hpp"

struct CustomProperty
{
    template <typename Env> requires ::stdexec::tag_invocable<CustomProperty, Env>
    constexpr decltype(auto) operator()(Env&& env) const {
        return ::stdexec::tag_invoke(*this, std::forward<Env>(env));
    }
};

constexpr CustomProperty my_custom_property {};

int main()
{
    constexpr auto env = ::stdexec::env{::stdexec::prop{my_custom_property, 123}};

    static_assert(my_custom_property(env) == 123);
}

and with clang (19 or 20) it fails (gcc 13 also fails but gcc 15 is fine):

<source>:18:81: error: missing field '__elem1' initializer [-Werror,-Wmissing-field-initializers]
   18 |     constexpr auto env = ::stdexec::env{::stdexec::prop{my_custom_property, 123}};

I'm not sure whether this is due to a new recent commit but it used to work just fine a few weeks ago. Today I'm using e5dbe49.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions