PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / g++.dg / uninit-pred-2_b.C
blob5023fc50b6b2b642b2448e266275d656027766cb
1 /* { dg-do compile } */
2 /* { dg-options "-Wuninitialized -O2" } */
4 typedef long long int64;
5 void incr ();
6 bool is_valid (int);
7 int  get_time ();
9 class A 
11 public:
12   A ();
13   ~A () {
14     if (I) delete I;
15   }
17 private:
18   int* I;
21 bool get_url (A *);
23 class M {
25  public:
26 __attribute__ ((always_inline))  bool GetC (int *c)  {
28     A details_str;
29     if (get_url (&details_str))
30       {
31         *c = get_time ();
32         return true;
33       }
35     return false;
36   }
38   void do_sth();
39   void do_sth2();
40    
41   void P (int64 t)
42     {
43       int cc; /* { dg-message "note: 'cc' was declared here" } */
44       if (GetC (&cc)) /* return flag checked wrongly */
45         return;
46       
47       if (cc <= 0)  /* { dg-warning "uninitialized" "uninitialized variable warning" } */
48         {
49           this->do_sth();
50           return;
51         }
53     do_sth2();
54   }
57 M* m; 
58 void foo(int x)
60   m = new M;
61   m->P(x);