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).
45 lines
1.6 KiB
C++
45 lines
1.6 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -pedantic -verify -DPEDANTIC %s
|
|
// RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify %s
|
|
// RUN: %clang_cc1 -fsyntax-only -Wextra-semi -verify -std=c++11 %s
|
|
// RUN: cp %s %t
|
|
// RUN: %clang_cc1 -x c++ -Wextra-semi -fixit %t
|
|
// RUN: %clang_cc1 -x c++ -Wextra-semi -Werror %t
|
|
|
|
class A {
|
|
void A1();
|
|
void A2() { };
|
|
#ifndef PEDANTIC
|
|
// This warning is only produced if we specify -Wextra-semi, and not if only
|
|
// -pedantic is specified, since one semicolon is technically permitted.
|
|
// expected-warning@-4{{extra ';' after member function definition}}
|
|
#endif
|
|
void A2b() { };; // expected-warning{{extra ';' after member function definition}}
|
|
; // expected-warning{{extra ';' inside a class}}
|
|
void A2c() { }
|
|
;
|
|
#ifndef PEDANTIC
|
|
// expected-warning@-2{{extra ';' after member function definition}}
|
|
#endif
|
|
void A3() { }; ;; // expected-warning{{extra ';' after member function definition}}
|
|
;;;;;;; // expected-warning{{extra ';' inside a class}}
|
|
; // expected-warning{{extra ';' inside a class}}
|
|
; ;; ; ;;; // expected-warning{{extra ';' inside a class}}
|
|
; ; ; ; ;; // expected-warning{{extra ';' inside a class}}
|
|
void A4();
|
|
};
|
|
|
|
union B {
|
|
int a1;
|
|
int a2;; // expected-warning{{extra ';' inside a union}}
|
|
};
|
|
|
|
;
|
|
; ;;
|
|
#if __cplusplus < 201103L
|
|
// expected-warning@-3{{extra ';' outside of a function is a C++11 extension}}
|
|
// expected-warning@-3{{extra ';' outside of a function is a C++11 extension}}
|
|
#elif !defined(PEDANTIC)
|
|
// expected-warning@-6{{extra ';' outside of a function is incompatible with C++98}}
|
|
// expected-warning@-6{{extra ';' outside of a function is incompatible with C++98}}
|
|
#endif
|