aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.6/gcc/testsuite/g++.dg/pr51151.C')
-rw-r--r--gcc-4.6/gcc/testsuite/g++.dg/pr51151.C12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C b/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C
new file mode 100644
index 0000000..804498b
--- /dev/null
+++ b/gcc-4.6/gcc/testsuite/g++.dg/pr51151.C
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Woverflow" } */
+template<typename T> class C {
+public:
+ void f() {
+ m = c2 + 1;
+ }
+ static const long unsigned int c1 = 7;
+ static const int c2 = c1 - 1;
+ int m;
+};
+template class C<int>;