aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/crash2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/crash2.C')
-rw-r--r--gcc/testsuite/g++.dg/template/crash2.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/crash2.C b/gcc/testsuite/g++.dg/template/crash2.C
new file mode 100644
index 00000000000..e6cc965ff03
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash2.C
@@ -0,0 +1,31 @@
+// { dg-options "" }
+
+template <class EnumType>
+class A
+{
+public:
+ static const EnumType size = max; // { dg-error "" }
+ int table[size];
+};
+template <class EnumType>
+const EnumType A<EnumType>::size;
+
+
+namespace N
+{
+enum E { max = 5 };
+
+struct B
+{
+ A<E> a; // { dg-error "" }
+};
+
+}
+
+int
+main()
+{
+ N::B b;
+
+ return 0;
+}