gcc/testsuite/g++.dg/warn/mvp2.C
raw| 1 | // PR c++/83592 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-Wparentheses" } |
| 4 | |
| 5 | // Test that -Wparentheses does not give bogus warnings in |
| 6 | // typename context. |
| 7 | |
| 8 | int * |
| 9 | foo (long &a) |
| 10 | { |
| 11 | return reinterpret_cast<int (*)> (&a); |
| 12 | } |
| 13 | |
| 14 | int * |
| 15 | bar (long &a) |
| 16 | { |
| 17 | return (int (*)) &a; |
| 18 | } |
| 19 | |
| 20 | int * |
| 21 | baz (int &a) |
| 22 | { |
| 23 | return static_cast<int (*const)> (&a); |
| 24 | } |