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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Boris Staletic from comment #3)
> auto bind_function() {
>     constexpr auto attrs = extra_attributes{};
>     sink(attrs.rvp);
> }
> 
> And this one compiles:
> 
> auto bind_function() {
>     constexpr auto attrs = extra_attributes{};
>     char rvp = attrs.rvp;
>     sink(rvp);
> }
> 
> I'd expect all three versions to work, but if not, then at least to behave
> the same.

In the latter case it compiles because attrs.rvp in there is constant evaluated
(not manifestly-constant evaluated though) to 0, which is done e.g. for var
initializers, while random subexpressions of other expressions (like the call
in the first case) are not.

Reply via email to