cb424d7448
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).
66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
// RUN: %clang_cc1 -verify %s -DTEST=1
|
|
// RUN: %clang_cc1 -verify %s -DTEST=2
|
|
// RUN: %clang_cc1 -verify %s -DTEST=3
|
|
// REQUIRES: thread_support
|
|
|
|
// FIXME: Detection of, or recovery from, stack exhaustion does not work on
|
|
// NetBSD at the moment. Since this is a best-effort mitigation for exceeding
|
|
// implementation limits, just disable the test.
|
|
// UNSUPPORTED: system-netbsd
|
|
|
|
// asan has own stack-overflow check.
|
|
// UNSUPPORTED: asan
|
|
|
|
// expected-warning@* 0-1{{stack nearly exhausted}}
|
|
// expected-note@* 0+{{}}
|
|
|
|
#if TEST == 1
|
|
|
|
template<int N> struct X : X<N-1> {};
|
|
template<> struct X<0> {};
|
|
X<1000> x;
|
|
|
|
template<typename ...T> struct tuple {};
|
|
template<typename ...T> auto f(tuple<T...> t) -> decltype(f(tuple<T...>(t))) {} // expected-error {{exceeded maximum depth}}
|
|
void g() { f(tuple<int, int>()); }
|
|
|
|
int f(X<0>);
|
|
template<int N> auto f(X<N>) -> f(X<N-1>());
|
|
|
|
int k = f(X<1000>());
|
|
|
|
#elif TEST == 2
|
|
|
|
namespace template_argument_recursion {
|
|
struct ostream;
|
|
template<typename T> T &&declval();
|
|
|
|
namespace mlir {
|
|
template<typename T, typename = decltype(declval<ostream&>() << declval<T&>())>
|
|
ostream &operator<<(ostream& os, const T& obj); // expected-error {{exceeded maximum depth}}
|
|
struct Value;
|
|
}
|
|
|
|
void printFunctionalType(ostream &os, mlir::Value &v) { os << v; }
|
|
}
|
|
|
|
#elif TEST == 3
|
|
|
|
namespace template_parameter_type_recursion {
|
|
struct ostream;
|
|
template<typename T> T &&declval();
|
|
template<bool B, typename T> struct enable_if { using type = T; };
|
|
|
|
namespace mlir {
|
|
template<typename T, typename enable_if<declval<ostream&>() << declval<T&>(), void*>::type = nullptr>
|
|
ostream &operator<<(ostream& os, const T& obj); // expected-error {{exceeded maximum depth}}
|
|
struct Value;
|
|
}
|
|
|
|
void printFunctionalType(ostream &os, mlir::Value &v) { os << v; }
|
|
}
|
|
|
|
#else
|
|
#error unknown test
|
|
#endif
|