1/* { dg-do compile } */
2/* { dg-options "-Wuninitialized -O2" } */
3
4typedef long long int64;
5void incr ();
6bool is_valid (int);
7int  get_time ();
8
9class A
10{
11public:
12  A ();
13  ~A () {
14    if (I) delete I;
15  }
16
17private:
18  int* I;
19};
20
21bool get_url (A *);
22
23class M {
24
25 public:
26__attribute__ ((always_inline))  int GetC (int *c)  {
27
28    A details_str;
29    if (!get_url (&details_str))
30      {
31        incr ();
32        return 1;
33      }
34
35    *c = get_time ();
36    return -1;
37  }
38
39  void do_sth();
40  void do_sth2();
41
42  void P (int64 t)
43    {
44      int cc; /* { dg-message "note: 'cc' was declared here" } */
45      if (GetC (&cc) <= 0 ) /* return flag checked wrongly */
46        return;
47
48      if (t && cc <= 0 )  /* { dg-warning "uninitialized" "uninitialized variable warning" } */
49        {
50          this->do_sth();
51          return;
52        }
53
54    do_sth2();
55  }
56};
57
58M* m;
59void foo(int x)
60{
61  m = new M;
62  m->P(x);
63}
64