view clang/test/Analysis/NewDeleteLeaks-PR18394.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900 (2020-02-13)
parents
children
line wrap: on
line source
// RUN: %clang_analyze_cc1 -analyzer-config graph-trim-interval=1 -analyzer-max-loop 1 -analyzer-checker=core,cplusplus.NewDeleteLeaks -verify %s
// expected-no-diagnostics

class A {
public:
  void f() {};
  ~A() {
    for (int i=0; i<3; i++)
      f();
  }
};

void error() {
  A *a = new A();
  delete a;
}