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

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 08:48:37 PST 2023


philnik777 wrote:

> 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.

No, there hasn't been one. I'll write one and address the details you mentioned.

> 
> 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.

I've noticed this too, but didn't have time to update the PR yet.

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


More information about the cfe-commits mailing list