diff options
author | David Malcolm <dmalcolm@redhat.com> | 2024-08-06 18:24:45 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2024-08-06 18:24:45 -0400 |
commit | 77f36e8016e11c051aa8264f3c43ab2c27aece55 (patch) | |
tree | be6883ae4e6cb54137256cc9a8ba7b2553f36214 /gcc/cp/parser.cc | |
parent | a50916a6c0a6c73c1537d033509d4f7034341f75 (diff) | |
download | gcc-77f36e8016e11c051aa8264f3c43ab2c27aece55.zip gcc-77f36e8016e11c051aa8264f3c43ab2c27aece55.tar.gz gcc-77f36e8016e11c051aa8264f3c43ab2c27aece55.tar.bz2 |
diagnostics: SARIF output: fix "executionSuccessful" §3.20.14 [PR116177]
Previously the invocation's "executionSuccessful" property (§3.20.14)
was only false if there was an ICE.
Update it so that it will also be false if we will exit with a non-zero
exit code (due to errors, Werror, and "sorry").
gcc/ChangeLog:
PR other/116177
* diagnostic-format-sarif.cc (sarif_invocation::prepare_to_flush):
If the diagnostics would lead to us exiting with a failure code,
then emit "executionSuccessful": False (SARIF v2.1.0 section
§3.20.14).
* diagnostic.cc (diagnostic_context::execution_failed_p): New.
* diagnostic.h (diagnostic_context::execution_failed_p): New decl.
* toplev.cc (toplev::main): Use it for determining returned value.
gcc/testsuite/ChangeLog:
PR other/116177
* gcc.dg/sarif-output/include-chain-2.c: Remove pruning of
"exit status is 1", as we expect this to exit with 0.
* gcc.dg/sarif-output/no-diagnostics.c: New test.
* gcc.dg/sarif-output/test-include-chain-1.py
(test_execution_unsuccessful): Add.
* gcc.dg/sarif-output/test-include-chain-2.py
(test_execution_successful): Add.
* gcc.dg/sarif-output/test-missing-semicolon.py
(test_execution_unsuccessful): Add.
* gcc.dg/sarif-output/test-no-diagnostics.py: New test.
* gcc.dg/sarif-output/test-werror.py: New test.
* gcc.dg/sarif-output/werror.c: New test.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc/cp/parser.cc')
0 files changed, 0 insertions, 0 deletions