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

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 29 22:14:17 PST 2023


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

Also generic lambdas is probably a big one to think about as well. 

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


More information about the cfe-commits mailing list