| 1 |
/* { dg-additional-options "-fanalyzer-show-events-in-system-headers" } */ |
| 2 |
/* { dg-skip-if "no shared_ptr in C++98" { c++98_only } } */ |
| 3 |
/* { dg-skip-if "requires hosted libstdc++ for memory shared_ptr" { ! hostedlib } } */ |
| 4 |
|
| 5 |
#include <memory> |
| 6 |
|
| 7 |
struct A {int x; int y;}; |
| 8 |
|
| 9 |
int main () { /* { dg-message "\\(1\\) entry to 'main'" "telltale event that we are going within a deeper frame than 'main'" } */ |
| 10 |
std::shared_ptr<A> a; |
| 11 |
a->x = 4; /* { dg-line deref_a } */ |
| 12 |
/* { dg-warning "dereference of NULL" "" { target *-*-* } deref_a } */ |
| 13 |
|
| 14 |
return 0; |
| 15 |
} |