| 1 |
/* Example of GCC SARIF output for a deletion fix-it hint. */ |
| 2 |
|
| 3 |
{"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json", |
| 4 |
"version": "2.1.0", |
| 5 |
"runs": [{"tool": {"driver": {"name": "GNU C++17", |
| 6 |
"fullName": "GNU C++17 (GCC) version 15.0.1 20250203 (experimental) (x86_64-pc-linux-gnu)", |
| 7 |
"version": "15.0.1 20250203 (experimental)", |
| 8 |
"informationUri": "https://gcc.gnu.org/gcc-15/", |
| 9 |
"rules": []}}, |
| 10 |
"invocations": [{"executionSuccessful": false, |
| 11 |
"toolExecutionNotifications": []}], |
| 12 |
"artifacts": [{"location": {"uri": "t.cc", |
| 13 |
"uriBaseId": "PWD"}, |
| 14 |
"sourceLanguage": "cplusplus", |
| 15 |
"contents": {"text": "unsigned unsigned int i;\n"}, |
| 16 |
"roles": ["analysisTarget"]}], |
| 17 |
"results": [{"ruleId": "error", |
| 18 |
"level": "error", |
| 19 |
"message": {"text": "duplicate 'unsigned'"}, |
| 20 |
"locations": [{"physicalLocation": {"artifactLocation": {"uri": "t.cc", |
| 21 |
"uriBaseId": "PWD"}, |
| 22 |
"region": {"startLine": 1, |
| 23 |
"startColumn": 10, |
| 24 |
"endColumn": 18}, |
| 25 |
"contextRegion": {"startLine": 1, |
| 26 |
"snippet": {"text": "unsigned unsigned int i;\n"}}}}], |
| 27 |
"fixes": [{"artifactChanges": [{"artifactLocation": {"uri": "t.cc", |
| 28 |
"uriBaseId": "PWD"}, |
| 29 |
"replacements": [{"deletedRegion": {"startLine": 1, |
| 30 |
"startColumn": 10, |
| 31 |
"endColumn": 18}, |
| 32 |
"insertedContent": {"text": ""}}]}]}]}]}]} |
| 33 |
|
| 34 |
/* { dg-begin-multiline-output "" } |
| 35 |
t.cc:1:10: error: duplicate 'unsigned' |
| 36 |
1 | unsigned unsigned int i; |
| 37 |
| ^~~~~~~~ |
| 38 |
| -------- |
| 39 |
{ dg-end-multiline-output "" } */ |