| 1 |
/* PR c/98597 - ICE in -Wuninitialized printing a MEM_REF |
| 2 |
{ dg-do compile } |
| 3 |
{ dg-options "-O2 -Wall -fno-tree-vectorize" } */ |
| 4 |
|
| 5 |
/* After vectorization, the location of the warning that's off, |
| 6 |
the warning itself is still issued but it's swallowed by |
| 7 |
the dg-prune-output directive. Refer to pr102700. */ |
| 8 |
struct shared_count { |
| 9 |
shared_count () { } |
| 10 |
shared_count (shared_count &r) |
| 11 |
: pi (r.pi) { } // { dg-warning "\\\[-Wuninitialized" } |
| 12 |
int pi; |
| 13 |
}; |
| 14 |
|
| 15 |
// There's another (redundant) -Wuninitialized on the line below. |
| 16 |
struct shared_ptr { |
| 17 |
int ptr; |
| 18 |
shared_count refcount; |
| 19 |
}; |
| 20 |
|
| 21 |
struct Bar { |
| 22 |
Bar (int, shared_ptr); |
| 23 |
}; |
| 24 |
|
| 25 |
void g () { |
| 26 |
shared_ptr foo; |
| 27 |
Bar (0, foo); |
| 28 |
} |
| 29 |
|
| 30 |
// Prune out duplicates. |
| 31 |
// { dg-prune-output "-Wuninitialized" } |