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).
41 lines
1.0 KiB
C++
41 lines
1.0 KiB
C++
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: split-file %s %t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 %t/type_traits.cppm -emit-module-interface -o %t/type_traits.pcm
|
|
// RUN: %clang_cc1 -std=c++20 %t/test.cpp -fprebuilt-module-path=%t -verify
|
|
|
|
//--- type_traits.cppm
|
|
export module type_traits;
|
|
|
|
export template <typename T>
|
|
constexpr bool is_pod_v = __is_pod(T);
|
|
|
|
//--- test.cpp
|
|
// expected-no-diagnostics
|
|
import type_traits;
|
|
// Base is either void or wrapper<T>.
|
|
template <class Base> struct wrapper : Base {};
|
|
template <> struct wrapper<void> {};
|
|
|
|
// wrap<0>::type<T> is wrapper<T>, wrap<1>::type<T> is wrapper<wrapper<T>>,
|
|
// and so on.
|
|
template <int N>
|
|
struct wrap {
|
|
template <class Base>
|
|
using type = wrapper<typename wrap<N-1>::template type<Base>>;
|
|
};
|
|
|
|
template <>
|
|
struct wrap<0> {
|
|
template <class Base>
|
|
using type = wrapper<Base>;
|
|
};
|
|
|
|
inline constexpr int kMaxRank = 40;
|
|
template <int N, class Base = void>
|
|
using rank = typename wrap<N>::template type<Base>;
|
|
using rank_selector_t = rank<kMaxRank>;
|
|
|
|
static_assert(is_pod_v<rank_selector_t>, "Must be POD");
|