mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 19:46:41 +00:00

The uniqueing decl in PathDiagnostic is the declaration with the uniqueing loc, as stated by documentation comments. It is enough to include the uniqueing loc in the profile. It is possible to have objects with different uniqueing decl but same location, at least with templates. These belong to the same class and should have same profile. Reviewed By: vsavchenko, NoQ Differential Revision: https://reviews.llvm.org/D84843
17 lines
430 B
C++
17 lines
430 B
C++
// RUN: %clang_analyze_cc1 -verify %s \
|
|
// RUN: -analyzer-checker=security
|
|
|
|
void bzero(void *, unsigned long);
|
|
|
|
template <typename T> void foo(T l) {
|
|
// The warning comes from multiple instances and with
|
|
// different declarations that have same source location.
|
|
// One instance should be shown.
|
|
bzero(l, 1); // expected-warning{{The bzero() function is obsoleted}}
|
|
}
|
|
|
|
void p(int *p, unsigned *q) {
|
|
foo(p);
|
|
foo(q);
|
|
}
|