Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Misc/diagnostic-crash.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

40 lines
1.4 KiB
C++

// RUN: %clang_cc1 -verify -fsyntax-only %s
// The diagnostics we produce for this code tickled a bug in raw_ostream.
template <typename _Alloc> class allocator;
template <class _CharT> struct char_traits;
template <typename _CharT, typename _Traits = char_traits<_CharT>,
typename _Alloc = allocator<_CharT> >
class basic_string;
typedef basic_string<wchar_t> wstring;
class Closure {
};
template <class A1> class Callback1 {
};
template <class A1, class A2> class Callback2 {
};
template <class R, class A2> class ResultCallback1 {
};
template <bool del, class R, class T, class P1, class P2, class A1>
class AAAAAAAResultCallback_2_1 : public ResultCallback1<R, A1> {
};
template <bool del, class T, class P1, class P2, class A1>
class AAAAAAAResultCallback_2_1< del, void, T, P1, P2, A1> :
public Callback1<A1> {
public:
typedef Callback1<A1> base;
};
template <class T1, class T2, class R, class P1, class P2, class A1>
inline typename AAAAAAAResultCallback_2_1<true, R, T1, P1, P2, A1>::base*
NewCallback(T1* obj, R(T2::* member)(P1, P2, A1), const P1& p1, const P2& p2) {}
namespace util { class Status {}; }
class xxxxxxxxxxxxxxxxx {
void Bar(wstring* s, util::Status* status,
Callback2<util::Status, wstring>* done);
void Foo();
};
void xxxxxxxxxxxxxxxxx::Foo() {
wstring* s = __null;
util::Status* status = __null;
Closure* cb = NewCallback(this, &xxxxxxxxxxxxxxxxx::Bar, s, status); // expected-error{{cannot initialize}}
}