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

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 07:58:52 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
----------------
StefanPaulet wrote:

A diagnostic is emitted: `'constexpr' on lambda expressions is a C++17 extension`.
I could add a verification only for pre-c++17 errors (something like `until-cxx-17`). Should I do that or would it be overkill for this?

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


More information about the cfe-commits mailing list