-
Notifications
You must be signed in to change notification settings - Fork 227
Open
Description
The following code produces different results on Clang and GCC:
constexpr struct FwdFoo
: STDEXEC::__query<FwdFoo>
, STDEXEC::forwarding_query_t {
using STDEXEC::__query<FwdFoo>::operator();
} fwd_foo{};
constexpr struct Foo : STDEXEC::__query<Foo> {
} foo{};
constexpr struct Bar : STDEXEC::__query<Bar> {
} bar{};
constexpr bool test() {
auto env = STDEXEC::env{
STDEXEC::env{STDEXEC::prop{fwd_foo, 42.}, STDEXEC::prop{foo, 'F'}},
STDEXEC::prop{ bar, 31415}
};
static_assert(!STDEXEC::__queryable_with<decltype(env), Foo>); // clang agree, but not gcc !
return fwd_foo(env) == 42. && bar(env) == 31415;
}
static_assert(test());The assertion fails for gcc (tried out 12, 13, 14 and 15). I'm not sure what the expected behavior should be.
When the foo property is defined in the nested environment, and since it is not a forwarding query:
Should the outer environment be queryable for
foo?
@ericniebler I think it's important that this gets tested/standardized properly and consistently, as composing environments is something we do, but also nvexec and some standardized algorithms.
Here is a godbolt reproducer.
Joint work with @maartenarnst.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels