Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Parser/cxx2a-template-lambdas.cpp
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

43 lines
1.6 KiB
C++

// RUN: %clang_cc1 -std=c++23 %s -verify
// RUN: %clang_cc1 -std=c++20 %s -verify
auto L0 = []<> { }; //expected-error {{cannot be empty}}
auto L1 = []<typename T1, typename T2> { };
auto L2 = []<typename T1, typename T2>(T1 arg1, T2 arg2) -> T1 { };
auto L3 = []<typename T>(auto arg) { T t; };
auto L4 = []<int I>() { };
// http://llvm.org/PR49736
auto L5 = []<auto>(){};
auto L6 = []<auto>{};
auto L7 = []<auto>() noexcept {};
auto L8 = []<auto> noexcept {};
#if __cplusplus <= 202002L
// expected-warning@-2 {{lambda without a parameter clause is a C++23 extension}}
#endif
auto L9 = []<auto> requires true {};
auto L10 = []<auto> requires true(){};
auto L11 = []<auto> requires true() noexcept {};
auto L12 = []<auto> requires true noexcept {};
#if __cplusplus <= 202002L
// expected-warning@-2 {{is a C++23 extension}}
#endif
auto L13 = []<auto>() noexcept requires true {};
auto L14 = []<auto> requires true() noexcept requires true {};
auto XL0 = []<auto> noexcept requires true {}; // expected-error {{expected body of lambda expression}}
auto XL1 = []<auto> requires true noexcept requires true {}; // expected-error {{expected body}}
#if __cplusplus <= 202002L
// expected-warning@-3 {{is a C++23 extension}}
// expected-warning@-3 {{is a C++23 extension}}
#endif
namespace GH64962 {
void f() {
[] <typename T>(T i) -> int[] // expected-error {{function cannot return array type 'int[]'}}
// extension-warning {{explicit template parameter list for lambdas is a C++20 extension}}
{ return 3; } (v); // expected-error {{use of undeclared identifier 'v'}}
}
}