C++ Logo

liaison

Advanced search

Re: [isocpp-wg14/wg21-liaison] Attributes on expressions

From: Jan Schultke <janschultke_at_[hidden]>
Date: Mon, 6 Jul 2026 17:04:57 +0200
>
> Regarding the existing standard C++ attributes, I am not quite sure that
> any of them could meaningfully be applied to expressions; maybe just
> [[likely]]?
>

I also couldn't think of much, but using [[likely]] on one branch of a
conditional operator seems pretty reasonable.

Maybe there are some GNU attributes that would provide more motivation.

I've also once seen a discussion about an inlining attribute applied to
function call expressions, which would be interesting.

Received on 2026-07-06 15:05:13