Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
1ef688f
verify: Add the diagnostics a compilation reports verification result…
SwayamInSync Oct 27, 2026
9e9c599
verify: Add the cppverify group for verification warnings and proof r…
SwayamInSync Oct 27, 2026
45fae1d
verify: Make room for the verifier's frontend diagnostics.
SwayamInSync Oct 27, 2026
05ad788
verify: Describe a verification result as Clang diagnostic parts.
SwayamInSync Oct 27, 2026
71cc14c
verify: Declare the counterexample and path step renderers.
SwayamInSync Oct 27, 2026
83a355c
verify: Render counterexamples and path steps in source terms.
SwayamInSync Oct 27, 2026
8b95b34
verify: Build the counterexample renderer.
SwayamInSync Oct 27, 2026
4dd5d14
verify: Record where an expression begins.
SwayamInSync Oct 27, 2026
d743805
verify: Copy an expression's begin location with it.
SwayamInSync Oct 27, 2026
b90489e
verify: Mark source variables that are references.
SwayamInSync Oct 27, 2026
771f92f
verify: Record where each expression begins and which variables are r…
SwayamInSync Oct 27, 2026
fb42e15
verify: Carry each model variable's path condition and reference flag.
SwayamInSync Oct 27, 2026
5e5ce9d
verify: Record each variable version's path condition, and trace an o…
SwayamInSync Oct 27, 2026
21e5609
verify: Keep begin locations through spec inlining.
SwayamInSync Oct 27, 2026
2a38044
verify: Carry variable version guards and expression begin locations …
SwayamInSync Oct 27, 2026
9990f03
verify: Lower where each variable version is defined and where each e…
SwayamInSync Oct 27, 2026
bee1bbd
verify: Keep begin locations in simplification, and drop a guard that…
SwayamInSync Oct 27, 2026
e18f06f
verify: Move obligation archives to schema v4.
SwayamInSync Oct 27, 2026
23666cb
verify: Archive where each variable version is defined, from schema v4.
SwayamInSync Oct 27, 2026
e7e1aa4
verify: Keep begin locations when an induction copies a module.
SwayamInSync Oct 27, 2026
52b8ac2
verify: Carry the failing expression's start, and each value's path a…
SwayamInSync Oct 27, 2026
7b3e472
verify: Reset a result's begin location with its location.
SwayamInSync Oct 27, 2026
d2cd70a
verify: Evaluate whether each counterexample value lies on its path.
SwayamInSync Oct 27, 2026
4ac5b62
verify: Keep the start of the failing expression in cvc5 results.
SwayamInSync Oct 27, 2026
4d2b72e
verify: Mark references among the values of an unchecked counterexample.
SwayamInSync Oct 27, 2026
86da1bd
verify: Let a caller collect results as diagnostic parts.
SwayamInSync Oct 27, 2026
486bc85
verify: Print verification results as Clang diagnostics.
SwayamInSync Oct 27, 2026
407849b
verify: Return verification results to the compiler as diagnostic parts.
SwayamInSync Oct 27, 2026
3b8b67f
verify: Report compile-time verification results through the diagnost…
SwayamInSync Oct 27, 2026
f892938
verify: Print replayed failures with their counterexample and path no…
SwayamInSync Oct 27, 2026
7543831
test: Check the verification results a compilation reports.
SwayamInSync Oct 27, 2026
7dd7665
test: Check the range, counterexample, and path notes of a failure.
SwayamInSync Oct 27, 2026
dc0f99f
test: Read archive schema v4 and write records of schema v3.
SwayamInSync Oct 27, 2026
eb14c15
test: Replay archive schema v3 and reject an invalid guard flag.
SwayamInSync Oct 27, 2026
ac459b6
test: Expect archive schema v4 in obligation dumps.
SwayamInSync Oct 27, 2026
451d61f
test: Expect proofs as remarks at their functions in a compilation.
SwayamInSync Oct 27, 2026
d28040b
docs: Show a failure as a Clang diagnostic in the README.
SwayamInSync Oct 27, 2026
0dc9108
docs: Describe how a failure renders as Clang diagnostics, and archiv…
SwayamInSync Oct 27, 2026
9dca4de
docs: Note archive schema v4.
SwayamInSync Oct 27, 2026
834109b
docs: Note failures as Clang diagnostics and archive schema v4.
SwayamInSync Oct 27, 2026
0624186
docs: Document failures as Clang diagnostics, in cpp-verify and in a …
SwayamInSync Oct 27, 2026
6009a53
docs: Explain how to read a failure in chapter 16.
SwayamInSync Oct 27, 2026
03f879a
docs: Show shadowed loop counters as a counterexample names them.
SwayamInSync Oct 27, 2026
cf6bb08
docs: Show failures as Clang diagnostics in the functions and loops r…
SwayamInSync Oct 27, 2026
2f5a4d9
docs: Show failures as Clang diagnostics, and archive schema v4, in c…
SwayamInSync Oct 27, 2026
fac1772
test: Expect failures as Clang diagnostics in assertions.cpp.
SwayamInSync Oct 27, 2026
5252a75
test: Expect failures as Clang diagnostics in backend_model_names.cpp.
SwayamInSync Oct 27, 2026
72ce7ba
test: Expect failures as Clang diagnostics in backend_model_truth.cpp.
SwayamInSync Oct 27, 2026
78d8345
test: Expect failures as Clang diagnostics in backend_model_values.cpp.
SwayamInSync Oct 27, 2026
9872d5e
test: Expect failures as Clang diagnostics in backend_result_contract…
SwayamInSync Oct 27, 2026
f43f335
test: Expect failures as Clang diagnostics in backend_stable_id.test.
SwayamInSync Oct 27, 2026
a2d16a4
test: Expect failures as Clang diagnostics in behaviors.cpp.
SwayamInSync Oct 27, 2026
98f3c63
test: Expect failures as Clang diagnostics in bmc_incremental.cpp.
SwayamInSync Oct 27, 2026
c944cc1
test: Expect failures as Clang diagnostics in bounds_single_object.cpp.
SwayamInSync Oct 27, 2026
5dd960c
test: Expect failures as Clang diagnostics in calls_in_expressions.cpp.
SwayamInSync Oct 27, 2026
3c6ba1e
test: Expect failures as Clang diagnostics in certified_counterexampl…
SwayamInSync Oct 27, 2026
1213b5f
test: Expect failures as Clang diagnostics in certified_counterexampl…
SwayamInSync Oct 27, 2026
f7e5de8
test: Expect failures as Clang diagnostics in certified_failure_attri…
SwayamInSync Oct 27, 2026
27de023
test: Expect failures as Clang diagnostics in certified_quantifier_ra…
SwayamInSync Oct 27, 2026
6c71778
test: Expect failures as Clang diagnostics in choose.cpp.
SwayamInSync Oct 27, 2026
fc2200b
test: Expect failures as Clang diagnostics in choose_axioms.cpp.
SwayamInSync Oct 27, 2026
74f8693
test: Expect failures as Clang diagnostics in choose_identity.cpp.
SwayamInSync Oct 27, 2026
990222d
test: Expect failures as Clang diagnostics in choose_reads.cpp.
SwayamInSync Oct 27, 2026
1828477
test: Expect failures as Clang diagnostics in choose_recursion.cpp.
SwayamInSync Oct 27, 2026
47b90b1
test: Expect failures as Clang diagnostics in class_invariants.cpp.
SwayamInSync Oct 27, 2026
7992fd2
test: Expect failures as Clang diagnostics in class_templates.cpp.
SwayamInSync Oct 27, 2026
6613f1c
test: Expect failures as Clang diagnostics in collections.cpp.
SwayamInSync Oct 27, 2026
41ba7d1
test: Expect failures as Clang diagnostics in command_line.cpp.
SwayamInSync Oct 27, 2026
5b909ee
test: Expect failures as Clang diagnostics in constant_expressions.cpp.
SwayamInSync Oct 27, 2026
a01794d
test: Expect failures as Clang diagnostics in constructors.cpp.
SwayamInSync Oct 27, 2026
4812a6a
test: Expect failures as Clang diagnostics in contract_math.cpp.
SwayamInSync Oct 27, 2026
67e66cb
test: Expect failures as Clang diagnostics in contract_wellformedness…
SwayamInSync Oct 27, 2026
88355da
test: Expect failures as Clang diagnostics in contracts_across_files.…
SwayamInSync Oct 27, 2026
73c4b89
test: Expect failures as Clang diagnostics in counterexample_confirma…
SwayamInSync Oct 27, 2026
6f60405
test: Expect failures as Clang diagnostics in demoted_vacuity.cpp.
SwayamInSync Oct 27, 2026
ed5a84e
test: Expect failures as Clang diagnostics in dynamic_storage_fail.cpp.
SwayamInSync Oct 27, 2026
ced3098
test: Expect failures as Clang diagnostics in enum_ranges.cpp.
SwayamInSync Oct 27, 2026
2fb7027
test: Expect failures as Clang diagnostics in extent_separation.cpp.
SwayamInSync Oct 27, 2026
0b83f21
test: Expect failures as Clang diagnostics in forall_introduction.cpp.
SwayamInSync Oct 27, 2026
e0f25b3
test: Expect failures as Clang diagnostics in frame_call_objects.cpp.
SwayamInSync Oct 27, 2026
c392eb9
test: Expect failures as Clang diagnostics in frontend_gaps.cpp.
SwayamInSync Oct 27, 2026
c3d2137
test: Expect failures as Clang diagnostics in function_filter.cpp.
SwayamInSync Oct 27, 2026
eaa3c24
test: Expect failures as Clang diagnostics in function_templates.cpp.
SwayamInSync Oct 27, 2026
71014a2
test: Expect failures as Clang diagnostics in ghost_locals.cpp.
SwayamInSync Oct 27, 2026
d0d1825
test: Expect failures as Clang diagnostics in ghost_math_values.cpp.
SwayamInSync Oct 27, 2026
06026d0
test: Expect failures as Clang diagnostics in globals.cpp.
SwayamInSync Oct 27, 2026
d24ca40
test: Expect failures as Clang diagnostics in inductive_counterexampl…
SwayamInSync Oct 27, 2026
88e03be
test: Expect failures as Clang diagnostics in inductive_lemmas.cpp.
SwayamInSync Oct 27, 2026
e742613
test: Expect failures as Clang diagnostics in inductive_predicates.cpp.
SwayamInSync Oct 27, 2026
1929493
test: Expect failures as Clang diagnostics in inductive_unfolding.cpp.
SwayamInSync Oct 27, 2026
415932f
test: Expect failures as Clang diagnostics in integer_encoding.cpp.
SwayamInSync Oct 27, 2026
1fd1007
test: Expect failures as Clang diagnostics in lean_refutation.test.
SwayamInSync Oct 27, 2026
26e766d
test: Expect failures as Clang diagnostics in llvm_uleb128_mutation.cpp.
SwayamInSync Oct 27, 2026
b97f401
test: Expect failures as Clang diagnostics in llvm_uleb128_shift_ub.cpp.
SwayamInSync Oct 27, 2026
736df0e
test: Expect failures as Clang diagnostics in local_names.cpp.
SwayamInSync Oct 27, 2026
8810d5a
test: Expect failures as Clang diagnostics in local_object_unsupporte…
SwayamInSync Oct 27, 2026
b2487a2
test: Expect failures as Clang diagnostics in local_record_arguments.…
SwayamInSync Oct 27, 2026
6d6ee0b
test: Expect failures as Clang diagnostics in lookup_tables.cpp.
SwayamInSync Oct 27, 2026
abd4290
test: Expect failures as Clang diagnostics in loop_forms.cpp.
SwayamInSync Oct 27, 2026
cad8ba3
test: Expect failures as Clang diagnostics in loop_frames.cpp.
SwayamInSync Oct 27, 2026
04d651e
test: Expect failures as Clang diagnostics in loop_initialization.cpp.
SwayamInSync Oct 27, 2026
0742050
test: Expect failures as Clang diagnostics in loop_local_frames.cpp.
SwayamInSync Oct 27, 2026
81f6a91
test: Expect failures as Clang diagnostics in loop_termination.cpp.
SwayamInSync Oct 27, 2026
26dd41c
test: Expect failures as Clang diagnostics in max_failures.cpp.
SwayamInSync Oct 27, 2026
06d7388
test: Expect failures as Clang diagnostics in member_functions.cpp.
SwayamInSync Oct 27, 2026
ef7b278
test: Expect failures as Clang diagnostics in member_operators.cpp.
SwayamInSync Oct 27, 2026
5f8f267
test: Expect failures as Clang diagnostics in memory_objects.cpp.
SwayamInSync Oct 27, 2026
e07257f
test: Expect failures as Clang diagnostics in mutual_recursion.cpp.
SwayamInSync Oct 27, 2026
82d0a51
test: Expect failures as Clang diagnostics in nested_quantifier_count…
SwayamInSync Oct 27, 2026
ec47f44
test: Expect failures as Clang diagnostics in old_loop_invariant_defi…
SwayamInSync Oct 27, 2026
583bad8
test: Expect failures as Clang diagnostics in out_parameters.cpp.
SwayamInSync Oct 27, 2026
5772e2e
test: Expect failures as Clang diagnostics in parallel_functions.test.
SwayamInSync Oct 27, 2026
be95090
test: Expect failures as Clang diagnostics in pointer_difference_null…
SwayamInSync Oct 27, 2026
f8c4bc0
test: Expect failures as Clang diagnostics in pointer_field_extents.cpp.
SwayamInSync Oct 27, 2026
03c88f7
test: Expect failures as Clang diagnostics in pointer_origins.cpp.
SwayamInSync Oct 27, 2026
5bab400
test: Expect failures as Clang diagnostics in pointer_steps.cpp.
SwayamInSync Oct 27, 2026
025310d
test: Expect failures as Clang diagnostics in pointer_subobjects.cpp.
SwayamInSync Oct 27, 2026
75e0ed9
test: Expect failures as Clang diagnostics in proof_clusters.cpp.
SwayamInSync Oct 27, 2026
80c5338
test: Expect failures as Clang diagnostics in proof_steps.cpp.
SwayamInSync Oct 27, 2026
9006035
test: Expect failures as Clang diagnostics in range_for.cpp.
SwayamInSync Oct 27, 2026
7451a86
test: Expect failures as Clang diagnostics in read_instances.cpp.
SwayamInSync Oct 27, 2026
7e1ea19
test: Expect failures as Clang diagnostics in record_references.cpp.
SwayamInSync Oct 27, 2026
8b72a5a
test: Expect failures as Clang diagnostics in record_values_in_memory…
SwayamInSync Oct 27, 2026
0223e73
test: Expect failures as Clang diagnostics in region_frames.cpp.
SwayamInSync Oct 27, 2026
d52b4b6
test: Expect failures as Clang diagnostics in sequence_encoding_race.…
SwayamInSync Oct 27, 2026
429a679
test: Expect failures as Clang diagnostics in sequence_induction.cpp.
SwayamInSync Oct 27, 2026
9f96dc4
test: Expect failures as Clang diagnostics in sequences.cpp.
SwayamInSync Oct 27, 2026
419f0de
test: Expect failures as Clang diagnostics in sequences_cvc5.test.
SwayamInSync Oct 27, 2026
186ba35
test: Expect failures as Clang diagnostics in shift_language_mode.cpp.
SwayamInSync Oct 27, 2026
7851e20
test: Expect failures as Clang diagnostics in slice_argument_objects.…
SwayamInSync Oct 27, 2026
530eef8
test: Expect failures as Clang diagnostics in sound_modular_region_fr…
SwayamInSync Oct 27, 2026
93688bf
test: Expect failures as Clang diagnostics in sound_pointer_stride_fa…
SwayamInSync Oct 27, 2026
e60a94f
test: Expect failures as Clang diagnostics in spec_argument_modes.cpp.
SwayamInSync Oct 27, 2026
94cd598
test: Expect failures as Clang diagnostics in spec_automation.cpp.
SwayamInSync Oct 27, 2026
1695fe3
test: Expect failures as Clang diagnostics in spec_fuel_counterexampl…
SwayamInSync Oct 27, 2026
2a8476c
test: Expect failures as Clang diagnostics in spec_induction.cpp.
SwayamInSync Oct 27, 2026
2ceecd8
test: Expect failures as Clang diagnostics in spec_machine_conversion…
SwayamInSync Oct 27, 2026
5a10f92
test: Expect failures as Clang diagnostics in spec_mutual_recursion.cpp.
SwayamInSync Oct 27, 2026
10c7d76
test: Expect failures as Clang diagnostics in spec_post.cpp.
SwayamInSync Oct 27, 2026
9a97aaf
test: Expect failures as Clang diagnostics in spec_reads.cpp.
SwayamInSync Oct 27, 2026
e38d61c
test: Expect failures as Clang diagnostics in spec_reads_exact.cpp.
SwayamInSync Oct 27, 2026
8475527
test: Expect failures as Clang diagnostics in spec_termination.cpp.
SwayamInSync Oct 27, 2026
2ccfccf
test: Expect failures as Clang diagnostics in spec_when.cpp.
SwayamInSync Oct 27, 2026
9c710c6
test: Expect failures as Clang diagnostics in std_min_max.cpp.
SwayamInSync Oct 27, 2026
1ceffdf
test: Expect failures as Clang diagnostics in subobject_pointers.cpp.
SwayamInSync Oct 27, 2026
180609e
test: Expect failures as Clang diagnostics in switch_statements.cpp.
SwayamInSync Oct 27, 2026
2b047e3
test: Expect failures as Clang diagnostics in trusted_declarations.cpp.
SwayamInSync Oct 27, 2026
5062fec
test: Expect failures as Clang diagnostics in unbounded_quantifiers.cpp.
SwayamInSync Oct 27, 2026
93159eb
test: Expect failures as Clang diagnostics in uncontracted_assertions…
SwayamInSync Oct 27, 2026
92004e8
test: Expect failures as Clang diagnostics in valid_builtin.cpp.
SwayamInSync Oct 27, 2026
5269354
test: Expect failures as Clang diagnostics in z3_exec_recursion.cpp.
SwayamInSync Oct 27, 2026
fde22f5
test: Expect failures as Clang diagnostics in z3_parameter_rebinding.…
SwayamInSync Oct 27, 2026
3e5f1b7
test: Expect failures as Clang diagnostics in z3_references_fail.cpp.
SwayamInSync Oct 27, 2026
fe8dda5
test: Expect failures as Clang diagnostics in z3_spec_decreases_sound…
SwayamInSync Oct 27, 2026
475ccf3
test: Expect failures as Clang diagnostics in z3_undefined_behavior.cpp.
SwayamInSync Oct 27, 2026
d7fb413
docs: Show failures as Clang diagnostics in chapter 7.
SwayamInSync Oct 27, 2026
c395c69
docs: Show failures as Clang diagnostics in chapter 13.
SwayamInSync Oct 27, 2026
7bce66f
docs: Show failures as Clang diagnostics in chapter 14.
SwayamInSync Oct 27, 2026
a3c3169
docs: Show failures as Clang diagnostics in chapter 18.
SwayamInSync Oct 27, 2026
980703c
docs: Show failures as Clang diagnostics in chapter 20.
SwayamInSync Oct 27, 2026
bbc567c
docs: Show failures as Clang diagnostics in the binary search case st…
SwayamInSync Oct 27, 2026
0145657
docs: Show failures as Clang diagnostics in the ghost, spec, and proo…
SwayamInSync Oct 27, 2026
52f9e5c
docs: Show failures as Clang diagnostics in the integers reference.
SwayamInSync Oct 27, 2026
8fef279
docs: Show failures as Clang diagnostics in the pointers reference.
SwayamInSync Oct 27, 2026
a9a64ad
docs: Show failures as Clang diagnostics in the structs reference.
SwayamInSync Oct 27, 2026
90ba369
test: Check undecided steps and a check failing in an arbitrary loop …
SwayamInSync Oct 27, 2026
45f04ec
Merge branch 'fix/contract-link-check' into fix/clang-diagnostics
SwayamInSync Oct 27, 2026
fcaa641
verify: Record where a source range begins, apart from its anchor.
SwayamInSync Oct 27, 2026
ec625f5
verify: Reject a source range that begins after its anchor.
SwayamInSync Oct 27, 2026
235adfe
verify: Move obligation archives to schema v5.
SwayamInSync Oct 27, 2026
b7cab52
verify: Archive where each source range begins, from schema v5.
SwayamInSync Oct 27, 2026
67eea9b
verify: Carry the function of a conversion error with its location.
SwayamInSync Oct 27, 2026
e39f73a
verify: Record the location of the function a conversion error belong…
SwayamInSync Oct 27, 2026
9b6d70c
verify: Declare the JSON, SARIF, and GitHub output helpers.
SwayamInSync Oct 27, 2026
0268240
verify: Build SARIF logs and GitHub workflow commands from diagnostic…
SwayamInSync Oct 27, 2026
109f607
verify: Build the structured output helpers.
SwayamInSync Oct 27, 2026
4deccbd
verify: Declare the release version for structured output.
SwayamInSync Oct 27, 2026
08a2992
verify: Return the release version as --version names it.
SwayamInSync Oct 27, 2026
4daacbf
verify: Add the GitHub diagnostics format.
SwayamInSync Oct 27, 2026
4e99d16
verify: Print cppverify.diagnostic/2 records with exact ranges, and G…
SwayamInSync Oct 27, 2026
47a7e0c
verify: Add SARIF and GitHub output, compiler diagnostics as records,…
SwayamInSync Oct 27, 2026
3c9081d
test: Add the input of the structured output test.
SwayamInSync Oct 27, 2026
8f8970c
test: Add an input with a compiler error for the structured output test.
SwayamInSync Oct 27, 2026
7b70742
test: Check JSON v2, SARIF, and GitHub output.
SwayamInSync Oct 27, 2026
37219ef
test: Read archive schema v5 and write records of schema v4.
SwayamInSync Oct 27, 2026
4e122bb
test: Read cppverify.diagnostic/2 records and the summary record in t…
SwayamInSync Oct 27, 2026
cb789e2
test: Replay archive schema v4 and reject a range that begins after i…
SwayamInSync Oct 27, 2026
8fb55d5
test: Expect archive schema v5 in obligation dumps.
SwayamInSync Oct 27, 2026
83f4b03
docs: Name SARIF output in the README.
SwayamInSync Oct 27, 2026
43b5bdf
docs: Describe JSON v2, SARIF, GitHub output, and archive schema v5.
SwayamInSync Oct 27, 2026
9acc1d1
docs: Note JSON v2, SARIF, and archive schema v5.
SwayamInSync Oct 27, 2026
2dfc81c
docs: Document JSON v2, SARIF, and GitHub annotations.
SwayamInSync Oct 27, 2026
1b60e49
docs: Note JSON v2, SARIF, GitHub annotations, and archive schema v5.
SwayamInSync Oct 27, 2026
d166f2e
docs: Count SARIF and GitHub annotations among the shipped diagnostics.
SwayamInSync Oct 27, 2026
f87ba7e
docs: Name the JSON, SARIF, and GitHub formats in chapter 15.
SwayamInSync Oct 27, 2026
4694472
docs: Describe JSON v2 records and CI output in chapter 16.
SwayamInSync Oct 27, 2026
a9de50d
docs: Name archive schema v5 in chapter 17.
SwayamInSync Oct 27, 2026
6fa7efd
test: Expect cppverify.diagnostic/2 records in located_errors.cpp.
SwayamInSync Oct 27, 2026
13babaa
test: Expect cppverify.diagnostic/2 records in backend_model_names.cpp.
SwayamInSync Oct 27, 2026
8e92435
test: Expect cppverify.diagnostic/2 records in backend_model_truth.cpp.
SwayamInSync Oct 27, 2026
a5361c8
test: Expect cppverify.diagnostic/2 records in backend_stable_id.test.
SwayamInSync Oct 27, 2026
26f9faf
test: Expect cppverify.diagnostic/2 records in bmc_incremental.cpp.
SwayamInSync Oct 27, 2026
76c1466
test: Expect cppverify.diagnostic/2 records in contracts_across_files…
SwayamInSync Oct 27, 2026
e93f084
test: Expect cppverify.diagnostic/2 records in counterexample_confirm…
SwayamInSync Oct 27, 2026
9f60444
test: Expect cppverify.diagnostic/2 records in function_templates.cpp.
SwayamInSync Oct 27, 2026
dfa1e23
test: Expect cppverify.diagnostic/2 records in inductive_rules.cpp.
SwayamInSync Oct 27, 2026
4d3c787
test: Expect cppverify.diagnostic/2 records in interrupt.cpp.
SwayamInSync Oct 27, 2026
778881d
test: Expect cppverify.diagnostic/2 records in lean_automation.test.
SwayamInSync Oct 27, 2026
a95c5ee
test: Expect cppverify.diagnostic/2 records in lean_refutation.test.
SwayamInSync Oct 27, 2026
35258ff
test: Expect cppverify.diagnostic/2 records in lean_replay.test.
SwayamInSync Oct 27, 2026
f8fcb15
test: Expect cppverify.diagnostic/2 records in per_function_errors.test.
SwayamInSync Oct 27, 2026
4d09972
test: Expect cppverify.diagnostic/2 records in replay_dependencies.cpp.
SwayamInSync Oct 27, 2026
47fb08a
verify: Describe a certified counterexample in source terms with its …
SwayamInSync Oct 27, 2026
7a1a151
verify: Declare describeCounterexample in Certify.h.
SwayamInSync Oct 27, 2026
52782fe
verify: Describe each counterexample cvc5 finds as Z3's are.
SwayamInSync Oct 27, 2026
147c075
verify: Place a replayed counterexample note at its check.
SwayamInSync Oct 27, 2026
29e43c5
test: Check describeCounterexample in CertifyTest.
SwayamInSync Oct 27, 2026
804ce4f
test: Check cvc5 failure notes in failure_notes_cvc5.test.
SwayamInSync Oct 27, 2026
ac030be
test: Add a failure cvc5 answers unknown for failure_notes_cvc5.test.
SwayamInSync Oct 27, 2026
c9daecc
test: Expect the replayed counterexample note at its check in failure…
SwayamInSync Oct 27, 2026
60262f9
test: Expect the counterexample of either solver in solver_race.cpp.
SwayamInSync Oct 27, 2026
86fde3c
docs: Show a cvc5 failure with its counterexample in chapter 17.
SwayamInSync Oct 27, 2026
bc6cc49
docs: Say any solver's undetermined values stay unknown in chapter 16.
SwayamInSync Oct 27, 2026
88eebc8
docs: Drop the cvc5 counterexample limitation.
SwayamInSync Oct 27, 2026
c56b1bc
docs: Say cvc5 models are shown as Z3's in tooling.
SwayamInSync Oct 27, 2026
34bb2c7
docs: Note cvc5 counterexamples in the 0.2.0 release notes.
SwayamInSync Oct 27, 2026
ddf9a17
docs: Describe describeCounterexample in ARCHITECTURE.
SwayamInSync Oct 27, 2026
2d740ba
docs: Say cvc5 failures read like Z3 ones in DESIGN.
SwayamInSync Oct 27, 2026
3120dff
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 27, 2026
5bc252f
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 27, 2026
f419620
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 27, 2026
74cac50
test: Expect cppverify.diagnostic/2 records in obligation_size_limit.…
SwayamInSync Oct 27, 2026
48f0ce1
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 27, 2026
9b3563f
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
f854745
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
6878c63
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
227c60b
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
bbe92e9
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
a547916
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
adc5508
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
3addd3e
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
e6e609b
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
ba4923e
Merge main into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
98ff074
test: Give confirmation_invariants.cpp's failure a budget a slow macO…
SwayamInSync Oct 28, 2026
338f595
test: Give extent_separation.cpp's decided run a budget a slow macOS …
SwayamInSync Oct 28, 2026
5abc81f
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
6b42f1b
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
4091430
Merge main into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
4177231
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
1a7a6ce
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ and `docs/UB-CHECKING.md`.
./build/bin/cpp-verify --timeout=10000 --solver-rlimit=2000000 file.cpp
./build/bin/cpp-verify --int-encoding=bitvector file.cpp # auto (default) | integer | bitvector
./build/bin/cpp-verify --diagnostics-format=json file.cpp # JSON Lines, for editors/CI
./build/bin/cpp-verify --diagnostics-format=sarif file.cpp # SARIF 2.1.0, for code scanning
./build/bin/cpp-verify --obligation-out=goals.cpv file.cpp # backend-neutral archive
./build/bin/cpp-verify --dump-ir=1,2,3,4 file.cpp # VCR, passive, Obligation IR, Z3
```
Expand All @@ -165,9 +166,16 @@ Z3 runs support deterministic isolated solving (`--jobs`) and positive-proof reu
(`--proof-cache`). A query past `--timeout` or `--solver-rlimit` is reported as
*unresolved* rather than hanging — never as verified. `--int-encoding` only chooses
how machine integers reach the solver; every choice is exact, so it can change speed
but never a verdict. A failure names the function and the obligation that failed,
`<function identity>::<kind>@line:column`, e.g.
`verification failed: abs [fn_5f5a3361627369::overflow@5:3]`.
but never a verdict. A failure is a compiler error at the failing source, naming
the function and the kind of check, with its counterexample and path as notes;
without its precondition, `abs` gives:

```text
abs.cpp:4:3: error: verification failed: abs [overflow] [backend=z3] [reason=counterexample]
4 | return x < 0 ? -x : x;
| ^
abs.cpp:4:3: note: counterexample: x = -2147483648
```

Chained modular calls (e.g. `return inc(inc(x))`) are lowered to temporaries automatically.
See [Chapter 17](https://swayaminsync.github.io/cpp-verify/book/part-ii/ch17-backends-modular-calls.html).
Expand Down
4 changes: 4 additions & 0 deletions clang/include/clang/Basic/DiagnosticFrontendKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def err_fe_invalid_plugin_name : Error<
"unable to find plugin '%0'">;
def err_fe_cppverify_failed : Error<
"cppverify: %0">;
def err_cppverify_result : Error<"%0">;
def warn_cppverify_result : Warning<"%0">, InGroup<CppVerify>;
def remark_cppverify_result : Remark<"%0">, InGroup<CppVerify>;
def note_cppverify_result : Note<"%0">;
def err_fe_expected_compiler_job : Error<
"unable to handle compilation, expected exactly one compiler job in '%0'">;
def err_fe_expected_clang_command : Error<
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,9 @@ Results can be filtered by function name by passing
def : DiagGroup<"frame-larger-than=", [BackendFrameLargerThan]>;
def BackendPlugin : DiagGroup<"backend-plugin">;
def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
// cpp-verify's results in a compilation: its warnings, and its proofs as
// remarks.
def CppVerify : DiagGroup<"cppverify">;
def BackendOptimizationRemark : DiagGroup<"pass">;
def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum class Group;
enum {
DIAG_SIZE_COMMON = 300,
DIAG_SIZE_DRIVER = 400,
DIAG_SIZE_FRONTEND = 200,
DIAG_SIZE_FRONTEND = 250,
DIAG_SIZE_SERIALIZATION = 120,
DIAG_SIZE_LEX = 500,
DIAG_SIZE_PARSE = 800,
Expand Down
6 changes: 6 additions & 0 deletions clang/lib/Verify/Backend/CVC5Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2809,6 +2809,8 @@ CVC5VerifyBackend::verifyQuery(const ObligationModule &Module,
Result.Status = VerifyStatus::Failed;
Result.Reason = VerifyReason::Counterexample;
Result.CertifiedWith = std::move(Certified.Evidence);
describeCounterexample(Module, *Query, Candidate, Result,
checkLimits());
return Result;
}
} else {
Expand Down Expand Up @@ -2876,6 +2878,8 @@ CVC5VerifyBackend::verifyQuery(const ObligationModule &Module,
Result.Status = VerifyStatus::Failed;
Result.Reason = VerifyReason::Counterexample;
Result.CertifiedWith = Certified.Evidence;
describeCounterexample(Module, *Query, Candidate, Result,
checkLimits());
return Result;
}
if (Decision.Next == RefinementDecision::Action::Stop) {
Expand All @@ -2897,6 +2901,8 @@ VerifyResult CVC5VerifyBackend::verifyObligation(const ObligationModule &Module,
Result.ObligationId = Item.StableId.empty() ? Item.Id : Item.StableId;
Result.ObligationType = Item.Kind;
Result.Location = Item.Loc;
Result.BeginLocation = Item.BeginLoc;
Result.EndLocation = Item.EndLoc;
Result.Source = Item.Source;
if (Result.Status == VerifyStatus::Unresolved)
Result.Message = "proof obligation " + Result.ObligationId +
Expand Down
66 changes: 65 additions & 1 deletion clang/lib/Verify/Backend/Certify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4187,15 +4187,79 @@ verify::candidateValues(const ObligationModule &Module, const LogicExpr &Query,
It != Module.DiagnosticVariables.end() ? It->second.DisplayName : Name;
Value.InternalName = Name;
Value.Sort = Sort;
if (It != Module.DiagnosticVariables.end())
if (It != Module.DiagnosticVariables.end()) {
Value.Source = It->second.Source;
Value.Reference = It->second.Reference;
}
if (std::optional<LogicValue> Given = Model.constant(Name, Sort))
Value.Value = formatLogicValue(*Given);
Values.push_back(std::move(Value));
}
return Values;
}

void verify::describeCounterexample(const ObligationModule &Module,
const LogicExpr &Query,
CandidateModel &Model, VerifyResult &Result,
const CertifyLimits &Limits) {
auto evaluated = [&](const LogicExpr *Term) -> std::optional<LogicValue> {
if (!Term)
return std::nullopt;
return evaluateTerm(Module, *Term, Model, Limits);
};
auto truth = [&](const LogicExpr *Term) -> std::optional<bool> {
std::optional<LogicValue> Value = evaluated(Term);
if (!Value || Value->K != LogicValue::Kind::Bool)
return std::nullopt;
return Value->Truth;
};
const Obligation *Failing = nullptr;
for (const Obligation &Item : Module.Obligations)
if (Item.CounterexampleQuery.get() == &Query) {
Failing = &Item;
break;
}
if (Failing)
Result.Assignment = counterexampleAssignment(*Failing, Model);

// In the order Z3's models list them, by internal name.
Result.Model = candidateValues(Module, Query, Model);
llvm::sort(Result.Model,
[](const VerifyModelValue &A, const VerifyModelValue &B) {
return A.InternalName < B.InternalName;
});
for (VerifyModelValue &Value : Result.Model)
if (auto It = Module.DiagnosticVariables.find(Value.InternalName);
It != Module.DiagnosticVariables.end() && It->second.Guard)
Value.OnPath = truth(It->second.Guard.get());

Result.Trace.clear();
const uint64_t Count =
Failing ? std::min<uint64_t>(Failing->TraceEventCount,
Module.TraceEvents.size())
: 0;
for (uint64_t I = 0; I != Count; ++I) {
const DiagnosticTraceEvent &Event = Module.TraceEvents[I];
std::optional<bool> Active = truth(Event.Guard.get());
if (Active == false)
continue;
VerifyTraceEvent Step;
Step.Kind = Event.Kind;
Step.Message = Event.Message;
Step.Loc = Event.Loc;
Step.Source = Event.Source;
Step.Active = Active;
for (const DiagnosticTraceValue &Value : Event.Values) {
std::optional<LogicValue> Given = evaluated(Value.Value.get());
Step.Values.push_back(
{Value.Label, Value.Value->Sort,
Given ? std::optional<std::string>(formatLogicValue(*Given))
: std::nullopt});
}
Result.Trace.push_back(std::move(Step));
}
}

std::string verify::shownApplication(const ObligationModule &Module,
const LogicExpr &Application,
CandidateModel &Model,
Expand Down
10 changes: 10 additions & 0 deletions clang/lib/Verify/Backend/Certify.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ std::vector<VerifyModelValue> candidateValues(const ObligationModule &Module,
const LogicExpr &Query,
CandidateModel &Model);

/// Describes in \p Result the counterexample \p Model gives \p Query, an
/// obligation's counterexample query, as a failure shows it: the source
/// variables' values, each version marked on the path or off it, and the
/// steps of the obligation's path, each with its values. What the model
/// leaves open stays undetermined.
void describeCounterexample(const ObligationModule &Module,
const LogicExpr &Query, CandidateModel &Model,
VerifyResult &Result,
const CertifyLimits &Limits = {});

/// \p Application with its arguments' values under \p Model, as
/// "fibo(1000000000)".
std::string shownApplication(const ObligationModule &Module,
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Verify/Backend/Induction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ std::unique_ptr<LogicExpr> node(LogicExpr::Kind K, LogicSort Sort,
Node->Sort = Sort;
if (At) {
Node->Loc = At->Loc;
Node->BeginLoc = At->BeginLoc;
Node->EndLoc = At->EndLoc;
Node->Source = At->Source;
}
Expand Down Expand Up @@ -722,6 +723,7 @@ ObligationModule copyObligationModule(const ObligationModule &Module) {
Same.StableId = Item.StableId;
Same.Kind = Item.Kind;
Same.Loc = Item.Loc;
Same.BeginLoc = Item.BeginLoc;
Same.EndLoc = Item.EndLoc;
Same.Source = Item.Source;
Same.TraceEventCount = Item.TraceEventCount;
Expand Down
46 changes: 43 additions & 3 deletions clang/lib/Verify/Backend/Obligation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,15 @@ static bool validateSource(const ObligationSource &Source, std::string &Error) {
Error = "source range end precedes its start";
return false;
}
if ((Source.BeginLine == 0) != (Source.BeginColumn == 0)) {
Error = "source range has an incomplete begin";
return false;
}
if (Source.BeginLine > Source.Line ||
(Source.BeginLine == Source.Line && Source.BeginColumn > Source.Column)) {
Error = "source range begins after its anchor";
return false;
}
return true;
}

Expand Down Expand Up @@ -1960,8 +1969,10 @@ class ObligationBuilder {

std::unique_ptr<VCExpr> fromVExpr(const VExpr *E) {
auto Result = fromVExprImpl(E);
if (Result && E)
if (Result && E) {
Result->BeginLoc = E->BeginLoc;
Result->EndLoc = E->EndLoc;
}
return Result;
}

Expand Down Expand Up @@ -2389,8 +2400,9 @@ class ObligationBuilder {
fail("invalid diagnostic variable sort in obligation lowering");
continue;
}
M.DiagnosticVariables[InternalName] = {
Variable.DisplayName, Sort, Variable.Loc, Variable.EndLoc, {}};
DiagnosticVariable &Diagnostic = M.DiagnosticVariables[InternalName];
Diagnostic = {Variable.DisplayName, Sort, Variable.Loc, Variable.EndLoc};
Diagnostic.Reference = Variable.Reference;
}
auto traceKind = [](PassiveTraceKind Kind) {
switch (Kind) {
Expand Down Expand Up @@ -2432,6 +2444,17 @@ class ObligationBuilder {
{Value.Label, lowerDiagnosticExpr(Value.Value.get())});
M.TraceEvents.push_back(std::move(Lowered));
}
auto Everywhere = std::make_unique<VCExpr>(VCExpr::BoolLit);
setBoolSort(*Everywhere);
Everywhere->BoolVal = true;
const LogicExprRef OnEveryPath(std::move(Everywhere));
for (const auto &[InternalName, Variable] : P.ModelVariables)
if (auto It = M.DiagnosticVariables.find(InternalName);
It != M.DiagnosticVariables.end())
It->second.Guard =
Variable.Guard
? LogicExprRef(lowerDiagnosticExpr(Variable.Guard.get()))
: OnEveryPath;

std::vector<std::unique_ptr<VCExpr>> EntryAssumes;
for (const auto &Entry : P.EntryAssumes)
Expand Down Expand Up @@ -2523,6 +2546,7 @@ class ObligationBuilder {
ConditionWP->Premise = It->second.empty() ? "fact" : It->second;
}
ConditionWP->Loc = Condition->Loc;
ConditionWP->BeginLoc = Condition->BeginLoc;
ConditionWP->EndLoc = Condition->EndLoc;
return ConditionWP;
};
Expand All @@ -2539,12 +2563,14 @@ class ObligationBuilder {
Item.Kind = Kind;
Item.Note = Note;
Item.Loc = Condition->Loc;
Item.BeginLoc = Condition->BeginLoc;
Item.EndLoc = Condition->EndLoc;
Item.TraceEventCount = TraceEventCount;
Item.Id = Identity + "::obligation:" + std::to_string(++ObligationIndex);
Item.Goal = makeGoal(Condition);
Item.CounterexampleQuery = vcNot(cloneLogicExpr(Item.Goal.get()));
Item.CounterexampleQuery->Loc = Condition->Loc;
Item.CounterexampleQuery->BeginLoc = Condition->BeginLoc;
Item.CounterexampleQuery->EndLoc = Condition->EndLoc;
M.Obligations.push_back(std::move(Item));
};
Expand Down Expand Up @@ -2612,6 +2638,9 @@ verify::validateObligationModule(const ObligationModule &M) {
for (const DiagnosticTraceValue &Value : Event.Values)
Roots.push_back(Value.Value.get());
}
for (const auto &[InternalName, Variable] : M.DiagnosticVariables)
if (Variable.Guard)
Roots.push_back(Variable.Guard.get());
Roots.push_back(M.CorrectnessGoal.get());
Roots.push_back(M.CounterexampleQuery.get());
for (const Obligation &Item : M.Obligations) {
Expand Down Expand Up @@ -2678,6 +2707,17 @@ verify::validateObligationModule(const ObligationModule &M) {
llvm::inconvertibleErrorCode(),
"obligation module has invalid diagnostic trace value");
}
for (const auto &[InternalName, Variable] : M.DiagnosticVariables)
if (Variable.Guard &&
(!validateLogicExpr(Variable.Guard.get(), ValidationError,
&WellFormed) ||
!validateLogicCalls(Variable.Guard.get(), M.LogicFunctions,
ValidationError, &CallsChecked) ||
!ModuleScopes.validate(Variable.Guard.get(), ValidationError) ||
Variable.Guard->Sort.Kind != LogicSortKind::Bool))
return llvm::createStringError(
llvm::inconvertibleErrorCode(),
"obligation module has an invalid diagnostic variable guard");
if (!validateLogicExpr(M.CorrectnessGoal.get(), ValidationError, &WellFormed))
return llvm::createStringError(llvm::inconvertibleErrorCode(), "%s",
ValidationError.c_str());
Expand Down
16 changes: 16 additions & 0 deletions clang/lib/Verify/Backend/Obligation.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,24 @@ std::string formatLogicFeatures(LogicFeatureSet Features);
const char *logicSortName(LogicSortKind Kind);
std::string formatLogicSort(const LogicSort &Sort);

/// Where a term comes from: its anchor (Line, Column), where a diagnostic
/// points and a stable ID is built, in the source it spans, from its begin to
/// the column after its last character.
struct ObligationSource {
std::string File;
unsigned Line = 0;
unsigned Column = 0;
unsigned EndLine = 0;
unsigned EndColumn = 0;
/// The start of the span, before the anchor (an operator's operands);
/// zero when it is the anchor.
unsigned BeginLine = 0;
unsigned BeginColumn = 0;

bool isValid() const { return !File.empty() && Line != 0; }
bool hasRange() const { return isValid() && EndLine != 0; }
unsigned beginLine() const { return BeginLine ? BeginLine : Line; }
unsigned beginColumn() const { return BeginLine ? BeginColumn : Column; }
};

class LogicExpr;
Expand Down Expand Up @@ -210,6 +219,7 @@ class LogicExpr : public llvm::ThreadSafeRefCountedBase<LogicExpr> {
Kind K;
LogicSort Sort;
SourceLocation Loc;
SourceLocation BeginLoc;
SourceLocation EndLoc;
/// Where Loc lies, filled in by the driver once the term is built
/// (annotateObligationSources): the one field written after a term is
Expand Down Expand Up @@ -313,6 +323,7 @@ struct Obligation {
std::string StableId;
ObligationKind Kind = ObligationKind::Assertion;
SourceLocation Loc;
SourceLocation BeginLoc;
SourceLocation EndLoc;
ObligationSource Source;
uint64_t TraceEventCount = 0;
Expand All @@ -329,6 +340,11 @@ struct DiagnosticVariable {
SourceLocation Loc;
SourceLocation EndLoc;
ObligationSource Source;
/// A reference: its value is the address it refers to. Not archived.
bool Reference = false;
/// Where this version is defined, as PassiveModelVariable::Guard (true on
/// every path); null when unknown, as in an archive before version 4.
LogicExprRef Guard = nullptr;
};

struct LogicFunctionParameter {
Expand Down
Loading
Loading