[clang] [clang] Accept lambdas in C++03 as an extensions (PR #73376)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 07:01:39 PST 2023


https://github.com/AaronBallman commented:

Was there an RFC asking the community about exposing lambdas in pre C++11 modes? This is a sufficiently large language extension that we probably should verify if we haven't already. I believe this is a conforming extension (I can't think of a circumstance under which we'd take correct C++98 code and treat it differently), but I don't think it's as simple as you've done here. For example, `noexcept` is a C++11-ism and can appear on a lambda. `constexpr` as well, trailing return types, etc. So we'd need a better understanding of what features of lambdas you intend to enable and just how much of the syntax you expect to work in older modes.

The changes should also come with a release note and we need to update `Language Extensions Back-ported to Previous Standards` in LanguageExtensions.rst to document this.

https://github.com/llvm/llvm-project/pull/73376


More information about the cfe-commits mailing list