PR c++/33553
* pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
value dependent expression.
* g++.dg/template/array19.C: New test.
From-SVN: r132126
+2008-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/33553
+ * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
+ value dependent expression.
+
2008-02-05 Douglas Gregor <doug.gregor@gmail.com>
PR c++/35074
/*integral_constant_expression_p=*/false);
max = fold_decl_constant_value (max);
- if (TREE_CODE (max) != INTEGER_CST
- && TREE_CODE (max) != TEMPLATE_PARM_INDEX
- && !at_function_scope_p ())
+ if (TREE_CODE (max) != INTEGER_CST
+ && !at_function_scope_p ()
+ && !value_dependent_expression_p (max))
{
if (complain & tf_error)
error ("array bound is not an integer constant");
+2008-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/33553
+ * g++.dg/template/array19.C: New test.
+
2008-02-05 Diego Novillo <dnovillo@google.com>
http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00140.html
--- /dev/null
+// PR c++/33553
+// { dg-do compile }
+
+template <class T> struct S { static const int sz = 2; };
+template <class T> struct U { enum { sz = 2 }; };
+
+template <class R>
+struct P
+{
+ template <class T> void bar (int (&x)[S<T>::sz]);
+ template <class T> void baz (int (&x)[U<T>::sz]);
+};
+
+P<int> p;
+
+void
+foo (void)
+{
+ int x[2];
+ p.bar<int> (x);
+ p.baz<int> (x);
+}