I have some (AST-based) checkers that detect type bugs, i.e. cases where a specific type is incorrect. Unfortunately, I cannot find any way to make the Clang Static Analyzer accept a TypeLoc as the error location, since PathDiagnosticLocation only has overloads for Stmt and Decl. It also has one accepting a SourceLocation, but I want to highlight the entire range. So I’d need either an overload accepting a SourceRange, or two SourceLocations.
Currently I’m just displaying the variable/parameter definition as the error location, which is all right, I guess, but not ideal. Is there any way to achieve the above? The ability to report any SourceRange as error location would be very useful, I believe.