[Bug c++/96485] Lambda parsing regression in GCCs 9 and onwards

s_gccbugzilla at nedprod dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 5 18:13:14 GMT 2020


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.


More information about the Gcc-bugs mailing list