Skip to content

Instantly share code, notes, and snippets.

@davidmalcolm
Created August 6, 2024 15:48
Show Gist options
  • Save davidmalcolm/38cff5c1995d21fc7d7abbecb3e25a85 to your computer and use it in GitHub Desktop.
Save davidmalcolm/38cff5c1995d21fc7d7abbecb3e25a85 to your computer and use it in GitHub Desktop.
{"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"version": "2.1.0",
"runs": [{"tool": {"driver": {"name": "GNU C++20",
"fullName": "GNU C++20 (GCC) version 15.0.0 20240805 (experimental) (x86_64-pc-linux-gnu)",
"version": "15.0.0 20240805 (experimental)",
"informationUri": "https://gcc.gnu.org/gcc-15/",
"rules": []}},
"invocations": [{"arguments": ["./cc1plus",
"-quiet",
"-iprefix",
"/home/david/coding-3/gcc-newgit-analyzer-revamp3/build/gcc/../lib/gcc/x86_64-pc-linux-gnu/15.0.0/",
"-isystem",
"./include",
"-isystem",
"./include-fixed",
"-D_GNU_SOURCE",
"../../src/test-P3358/main.cc",
"-quiet",
"-dumpdir",
"a-",
"-dumpbase",
"main.cc",
"-dumpbase-ext",
".cc",
"-mtune=generic",
"-march=x86-64",
"-std=c++20",
"-fconcepts-diagnostics-depth=3",
"-fdiagnostics-format=sarif-file",
"-o",
"/tmp/ccypgtOT.s"],
"workingDirectory": {"uri": "/home/david/coding-3/gcc-newgit-analyzer-revamp3/build/gcc"},
"startTimeUtc": "2024-08-06T15:36:39Z",
"executionSuccessful": true,
"toolExecutionNotifications": [],
"endTimeUtc": "2024-08-06T15:36:39Z"}],
"originalUriBaseIds": {"PWD": {"uri": "file:///home/david/coding-3/gcc-newgit-analyzer-revamp3/build/gcc/"}},
"artifacts": [{"location": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"sourceLanguage": "cplusplus",
"contents": {"text": "#include \"animals.h\"\n#include \"pet.h\"\n\nvoid pet(pettable auto t);\n\nint main() {\n pet(lizard{});\n}\n"},
"roles": ["analysisTarget"]},
{"location": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"sourceLanguage": "cplusplus",
"contents": {"text": "template <class T>\nconcept has_member_pet = requires(T t) { t.pet(); };\n\ntemplate <class T>\nconcept has_default_pet = T::is_pettable;\n\ntemplate <class T>\nconcept pettable = has_member_pet<T> or has_default_pet<T>;\n"},
"roles": ["resultFile"]},
{"location": {"uri": "../../src/test-P3358/dog.h",
"uriBaseId": "PWD"},
"sourceLanguage": "cplusplus",
"contents": {"text": "struct dog {};\n\nvoid pet(dog);\n"},
"roles": ["resultFile"]},
{"location": {"uri": "../../src/test-P3358/cat.h",
"uriBaseId": "PWD"},
"sourceLanguage": "cplusplus",
"contents": {"text": "struct cat {};\n\nvoid pet(cat);\n"},
"roles": ["resultFile"]},
{"location": {"uri": "../../src/test-P3358/animals.h",
"uriBaseId": "PWD"},
"sourceLanguage": "cplusplus"}],
"results": [{"ruleId": "error",
"level": "error",
"message": {"text": "no matching function for call to ‘pet(lizard)’"},
"locations": [{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"region": {"startLine": 7,
"startColumn": 5,
"endColumn": 18},
"contextRegion": {"startLine": 7,
"snippet": {"text": " pet(lizard{});\n"}}},
"logicalLocations": [{"name": "main",
"fullyQualifiedName": "main",
"decoratedName": "main",
"kind": "function"}]}],
"relatedLocations": [{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"region": {"startLine": 4,
"startColumn": 6,
"endColumn": 9},
"contextRegion": {"startLine": 4,
"snippet": {"text": "void pet(pettable auto t);\n"}}},
"message": {"text": "candidate: ‘template<class auto:1> requires pettable<auto:1> void pet(auto:1)’"},
"properties": {"nestingLevel": 1}},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"region": {"startLine": 4,
"startColumn": 6,
"endColumn": 9},
"contextRegion": {"startLine": 4,
"snippet": {"text": "void pet(pettable auto t);\n"}}},
"message": {"text": "template argument deduction/substitution failed:"},
"properties": {"nestingLevel": 2}},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"region": {"startLine": 4,
"startColumn": 6,
"endColumn": 9},
"contextRegion": {"startLine": 4,
"snippet": {"text": "void pet(pettable auto t);\n"}}},
"message": {"text": "constraints not satisfied"},
"properties": {"nestingLevel": 3}},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"region": {"startLine": 8,
"startColumn": 20,
"endColumn": 59},
"contextRegion": {"startLine": 8,
"snippet": {"text": "concept pettable = has_member_pet<T> or has_default_pet<T>;\n"}}},
"message": {"text": "no operand of the disjunction is satisfied"},
"properties": {"nestingLevel": 4},
"id": 0,
"relationships": [{"target": 1,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"region": {"startLine": 8,
"startColumn": 20,
"endColumn": 59},
"contextRegion": {"startLine": 8,
"snippet": {"text": "concept pettable = has_member_pet<T> or has_default_pet<T>;\n"}}},
"message": {"text": "the operand ‘has_member_pet<T>’ is unsatisfied because"},
"properties": {"nestingLevel": 5},
"id": 2,
"relationships": [{"target": 1,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"region": {"startLine": 2,
"startColumn": 42,
"endColumn": 49},
"contextRegion": {"startLine": 2,
"snippet": {"text": "concept has_member_pet = requires(T t) { t.pet(); };\n"}}},
"message": {"text": "the required expression ‘t.pet()’ is invalid, because"},
"properties": {"nestingLevel": 6},
"id": 3,
"relationships": [{"target": 1,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"region": {"startLine": 2,
"startColumn": 42,
"endColumn": 47},
"contextRegion": {"startLine": 2,
"snippet": {"text": "concept has_member_pet = requires(T t) { t.pet(); };\n"}}},
"message": {"text": "‘struct lizard’ has no member named ‘pet’"},
"properties": {"nestingLevel": 7},
"id": 4,
"relationships": [{"target": 1,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"region": {"startLine": 8,
"startColumn": 20,
"endColumn": 59},
"contextRegion": {"startLine": 8,
"snippet": {"text": "concept pettable = has_member_pet<T> or has_default_pet<T>;\n"}}},
"message": {"text": "the operand ‘has_default_pet<T>’ is unsatisfied because"},
"properties": {"nestingLevel": 5},
"id": 5,
"relationships": [{"target": 1,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/pet.h",
"uriBaseId": "PWD"},
"region": {"startLine": 5,
"startColumn": 30,
"endColumn": 41},
"contextRegion": {"startLine": 5,
"snippet": {"text": "concept has_default_pet = T::is_pettable;\n"}}},
"message": {"text": "‘is_pettable’ is not a member of ‘lizard’"},
"properties": {"nestingLevel": 6},
"id": 6,
"relationships": [{"target": 1,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/dog.h",
"uriBaseId": "PWD"},
"region": {"startLine": 3,
"startColumn": 6,
"endColumn": 9},
"contextRegion": {"startLine": 3,
"snippet": {"text": "void pet(dog);\n"}}},
"message": {"text": "candidate: ‘void pet(dog)’"},
"properties": {"nestingLevel": 1},
"id": 7,
"relationships": [{"target": 8,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/dog.h",
"uriBaseId": "PWD"},
"region": {"startLine": 3,
"startColumn": 10,
"endColumn": 13},
"contextRegion": {"startLine": 3,
"snippet": {"text": "void pet(dog);\n"}}},
"message": {"text": "no known conversion for argument 1 from ‘lizard’ to ‘dog’"},
"properties": {"nestingLevel": 2},
"id": 9,
"relationships": [{"target": 8,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/cat.h",
"uriBaseId": "PWD"},
"region": {"startLine": 3,
"startColumn": 6,
"endColumn": 9},
"contextRegion": {"startLine": 3,
"snippet": {"text": "void pet(cat);\n"}}},
"message": {"text": "candidate: ‘void pet(cat)’"},
"properties": {"nestingLevel": 1},
"id": 10,
"relationships": [{"target": 11,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/cat.h",
"uriBaseId": "PWD"},
"region": {"startLine": 3,
"startColumn": 10,
"endColumn": 13},
"contextRegion": {"startLine": 3,
"snippet": {"text": "void pet(cat);\n"}}},
"message": {"text": "no known conversion for argument 1 from ‘lizard’ to ‘cat’"},
"properties": {"nestingLevel": 2},
"id": 12,
"relationships": [{"target": 11,
"kinds": ["isIncludedBy"]}]},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"region": {"startLine": 2},
"contextRegion": {"startLine": 2,
"snippet": {"text": "#include \"pet.h\"\n"}}},
"relationships": [{"target": 0,
"kinds": ["includes"]},
{"target": 2,
"kinds": ["includes"]},
{"target": 3,
"kinds": ["includes"]},
{"target": 4,
"kinds": ["includes"]},
{"target": 5,
"kinds": ["includes"]},
{"target": 6,
"kinds": ["includes"]}],
"id": 1},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/animals.h",
"uriBaseId": "PWD"},
"region": {"startLine": 1},
"contextRegion": {"startLine": 1,
"snippet": {"text": "#include \"dog.h\"\n"}}},
"relationships": [{"target": 7,
"kinds": ["includes"]},
{"target": 9,
"kinds": ["includes"]},
{"target": 13,
"kinds": ["isIncludedBy"]}],
"id": 8},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/animals.h",
"uriBaseId": "PWD"},
"region": {"startLine": 2},
"contextRegion": {"startLine": 2,
"snippet": {"text": "#include \"cat.h\"\n"}}},
"relationships": [{"target": 10,
"kinds": ["includes"]},
{"target": 12,
"kinds": ["includes"]},
{"target": 13,
"kinds": ["isIncludedBy"]}],
"id": 11},
{"physicalLocation": {"artifactLocation": {"uri": "../../src/test-P3358/main.cc",
"uriBaseId": "PWD"},
"region": {"startLine": 1},
"contextRegion": {"startLine": 1,
"snippet": {"text": "#include \"animals.h\"\n"}}},
"relationships": [{"target": 8,
"kinds": ["includes"]},
{"target": 11,
"kinds": ["includes"]}],
"id": 13}]}]}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment