[cfe-dev] [analyzer] template instantiations, multiple reports

Alexander Droste via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 15 13:10:31 PDT 2015


On 12.10.15 23:18, Devin Coughlin wrote:
>
>> On Oct 9, 2015, at 8:00 AM, Alexander Droste via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>>
>> Hi,
>>
>> does the analyzer always produce multiple reports
>> if the detected error is in a template that gets instantiated
>> in multiple translation units or is the check itself
>> then doing something wrong if bugs get reported more than once?
>
> The analyzer does not do any cross-translation unit uniquing. So if an error is detected in the same header in multiple translation units it will get reported multiple times. Also, if the analyzer notices that the last component of path diagnostic is in a header, it will try to report the diagnostic at the last location along the path in the mail file (see PathDiagnostic::resetDiagnosticLocationToMainFile()).
>
> Devin
>

Thanks for taking the time to clarify this!
-Alex



More information about the cfe-dev mailing list