gcc/testsuite/g++.dg/warn/Wparentheses-4.C
raw| 1 | // Test that -Wparentheses does not give bogus warnings in the |
| 2 | // presence of templates for non-plain assignment. Bug 17120. |
| 3 | |
| 4 | // { dg-do compile } |
| 5 | // { dg-options "-Wparentheses" } |
| 6 | |
| 7 | template<typename _Tp> |
| 8 | inline _Tp |
| 9 | cmath_power(_Tp __x, unsigned int __n) |
| 10 | { |
| 11 | while (__n >>= 1) |
| 12 | ; |
| 13 | return __x; |
| 14 | } |
| 15 | |
| 16 | int main() |
| 17 | { |
| 18 | cmath_power(1.0, 3); |
| 19 | } |