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

--- Comment #3 from Niall Douglas <s_gccbugzilla at nedprod dot com> ---
(In reply to Jakub Jelinek from comment #2)
> [[gnu::no_sanitize_undefined]] instead of the GNU __attribute__ is accepted,
> but as the C++ specification requires it applies to the type not the
> declaration and therefore it is ignored.

Obviously the above is an extract from production code. We were using lambdas
to wrap individual bits of unsafe code which trips the UB sanitiser. It would
be useful to retain that ability, as having to sprinkle the code with:

struct { auto operator()(auto...) const __attribute__((no_sanitize_undefined))
{ } }()(...); 

... seems retrograde.

Reply via email to