[clang] [clang] Add diagnostic for friend declaration of closure type member (PR #191419)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 15 04:50:27 PDT 2026


================
@@ -222,3 +222,19 @@ template <template <typename> class Template, typename Argument>
 using Bind = Instantiate<Internal<Template>::template Bind, Argument>;
 #endif
 } // namespace cwg1794
+
+namespace cwg1780 { // cwg1780: 22
+#if __cplusplus >= 201103L
+
+auto l = []() -> int { return 5; };
+using L = decltype(l);
+class A {
+#if __cplusplus >= 201703L
----------------
Endilll wrote:

Can't we declare lambda to be `constexpr` in C++11 to avoid this `#if`?

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


More information about the cfe-commits mailing list