gcc/testsuite/ChangeLog:
* g++.dg/analyzer/ctor-dtor-1.C: New test.
* g++.dg/analyzer/dyncast-1.C: New test.
* g++.dg/analyzer/vfunc-1.C: New test.
--- /dev/null
+#include "../../gcc.dg/analyzer/analyzer-decls.h"
+
+int foo_count;
+
+struct foo
+{
+ foo () __attribute__((noinline))
+ {
+ foo_count++;
+ }
+ ~foo () __attribute__((noinline))
+ {
+ foo_count--;
+ }
+};
+
+int main ()
+{
+ __analyzer_eval (foo_count == 0); // { dg-warning "TRUE" }
+ {
+ foo f;
+ __analyzer_eval (foo_count == 1); // { dg-warning "TRUE" }
+ }
+ __analyzer_eval (foo_count == 0); // { dg-warning "TRUE" }
+ return 0;
+}
--- /dev/null
+#include "../../gcc.dg/analyzer/analyzer-decls.h"
+
+struct base
+{
+ virtual ~base () {}
+};
+struct sub : public base
+{
+ int m_field;
+};
+
+int
+test_1 (base *p)
+{
+ if (sub *q = dynamic_cast <sub*> (p))
+ {
+ __analyzer_dump_path (); // { dg-message "path" }
+ return q->m_field;
+ }
+ return 0;
+}
--- /dev/null
+struct base
+{
+ virtual int fn () const;
+};
+struct sub : public base
+{
+ int fn () const;
+};
+
+int
+test_1 (base *p)
+{
+ return p->fn ();
+}