summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse/crash14.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/parse/crash14.C')
-rw-r--r--gcc/testsuite/g++.dg/parse/crash14.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/parse/crash14.C b/gcc/testsuite/g++.dg/parse/crash14.C
new file mode 100644
index 000000000..b4cf49a99
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash14.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// Contributed by: Giovanni Bajo <giovannibajo at libero dot it>
+// PR c++/14448: Fold constant initializers in templates
+
+template <int> struct A
+{
+ A();
+};
+
+
+template<typename T> void foo(T)
+{
+ static const int n=1+1;
+ A<n+1> a;
+}
+
+void bar()
+{
+ foo(0);
+}