summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wparentheses-4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wparentheses-4.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/Wparentheses-4.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-4.C b/gcc/testsuite/g++.dg/warn/Wparentheses-4.C
new file mode 100644
index 000000000..2048ed7c7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-4.C
@@ -0,0 +1,19 @@
+// Test that -Wparentheses does not give bogus warnings in the
+// presence of templates for non-plain assignment. Bug 17120.
+
+// { dg-do compile }
+// { dg-options "-Wparentheses" }
+
+template<typename _Tp>
+ inline _Tp
+ cmath_power(_Tp __x, unsigned int __n)
+ {
+ while (__n >>= 1)
+ ;
+ return __x;
+ }
+
+int main()
+{
+ cmath_power(1.0, 3);
+}