================
@@ -406,8 +406,23 @@ void SarifDocumentWriter::appendResult(const SarifResult
&Result) {
if (!Result.RelatedLocations.empty()) {
json::Array ReLocs;
- for (auto &Range : Result.RelatedLocations) {
- ReLocs.emplace_back(createLocation(createPhysicalLocation(Range)));
+ for (auto &RelatedLocation : Result.RelatedLocations) {
+ if (RelatedLocation.index() == 0) { // variant is a SarifChildResult
----------------
Sirraide wrote:
Er, if you’re going to use `std::variant`, then please use type-based rather
than index-based accessors (e.g. `std::get_if`).
https://github.com/llvm/llvm-project/pull/174106
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits