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).
48 lines
992 B
C++
48 lines
992 B
C++
// Test this without pch.
|
|
// RUN: %clang_cc1 %s -include %s -verify -fsyntax-only -Wuninitialized
|
|
|
|
// Test with pch.
|
|
// RUN: %clang_cc1 %s -emit-pch -o %t
|
|
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -Wuninitialized
|
|
|
|
// RUN: %clang_cc1 %s -emit-pch -fpch-instantiate-templates -o %t
|
|
// RUN: %clang_cc1 %s -include-pch %t -verify -fsyntax-only -Wuninitialized
|
|
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wuninitialized"
|
|
template <typename T>
|
|
struct TS1 {
|
|
void m() {
|
|
T a;
|
|
T b = a;
|
|
}
|
|
};
|
|
#pragma clang diagnostic pop
|
|
|
|
#else
|
|
|
|
|
|
template <typename T>
|
|
struct TS2 {
|
|
void m() {
|
|
T a;
|
|
T b = a; // expected-warning {{variable 'a' is uninitialized}} \
|
|
expected-note@44 {{in instantiation of member function}} \
|
|
expected-note@31 {{initialize the variable 'a' to silence}}
|
|
}
|
|
};
|
|
|
|
void f() {
|
|
TS1<int> ts1;
|
|
ts1.m();
|
|
|
|
|
|
TS2<int> ts2;
|
|
ts2.m();
|
|
}
|
|
|
|
#endif
|