summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/arg1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/template/arg1.C')
-rw-r--r--gcc/testsuite/g++.dg/template/arg1.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/arg1.C b/gcc/testsuite/g++.dg/template/arg1.C
new file mode 100644
index 000000000..f7a8b3150
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/arg1.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 21 Mar 2003 <nathan@codesourcery.com>
+
+// PR 9978. We rejected a constant expression.
+
+enum { val = 1 };
+
+template <class T>
+struct Bar
+{
+ static const int A = val;
+ static const int B = A + 1;
+};