// RUN: %clang_analyze_cc1 -analyzer-checker=cplusplus.NewDelete -verify %s
#include"Inputs/system-header-simulator-cxx.h"structS{S():Data(newint){}~S(){delete Data;}int*getData(){return Data;}private:int*Data;};int*freeAfterReturnTemp(){returnS().getData();// expected-warning {{Use of memory after it is freed}}
}int*freeAfterReturnLocal(){
S X;return X.getData();// expected-warning {{Use of memory after it is freed}}
}