1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
3 using size_t = decltype(sizeof(int));
4 void *operator new(size_t, void *p
) { return p
; }
12 template <typename Func
> myfunction(Func fn
) {
13 new (&storage
.buffer
) Func(fn
);
18 myfunction
create_func() {
21 return c
; // expected-warning {{Address of stack memory associated with local variable 'n' is still referred to by a temporary object on the stack upon returning to the caller. This will be a dangling reference}}