+2005-07-25 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/19208
+ * pt.c (tsubst): Use fold_non_dependent_expr to fold array domains.
+
2005-06-14 Mark Mitchell <mark@codesourcery.com>
PR c++/21987
/* The array dimension behaves like a non-type template arg,
in that we want to fold it as much as possible. */
max = tsubst_template_arg (omax, args, complain, in_decl);
- if (!processing_template_decl)
- max = decl_constant_value (max);
+ max = fold_non_dependent_expr (max);
if (integer_zerop (omax))
{
-// { dg-do compile }
-// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
-// PR c++/19208: Fold dependent array domains
-
-template <class C> struct if_t { typedef int type; };
-template <class T> struct ffff { static const bool value = true; };
-template <class A>
-struct bound_member_action
-{
- typedef char f[ffff<A>::value ? 1 : 2];
- template <class CT>
- bound_member_action(CT i, typename if_t<f>::type g) {}
-};
-bound_member_action<int> a(0, 1);
+// { dg-do compile }\r
+// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>\r
+// PR c++/19208: Fold dependent array domains\r
+\r
+template <class C> struct if_t { typedef int type; };\r
+template <class T> struct hhhh { static const bool value = true; };\r
+template <class T> struct gggg { static const bool value = hhhh<T>::value; };\r
+template <class T> struct ffff { static const bool value = gggg<T>::value; };\r
+template <class A>\r
+struct bound_member_action\r
+{\r
+ typedef char f[ffff<A>::value ? 1 : 2];\r
+ template <class CT>\r
+ bound_member_action(CT i, typename if_t<f>::type g) {}\r
+};\r
+\r
+bound_member_action<int> a(0, 1);\r