view clang/test/Analysis/report-uniqueing.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children
line wrap: on
line source

// 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);
}