'gcc-3_4-branch'.
From-SVN: r94148
--- /dev/null
+// { 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);
--- /dev/null
+/* PR middle-end/19551 */
+
+extern void abort ();
+
+#define T(type, name) \
+__attribute__((pure)) _Complex type \
+foo_##name (int x) \
+{ \
+ _Complex type r; \
+ __real r = x + 1; \
+ __imag r = x - 1; \
+ return r; \
+} \
+ \
+void \
+bar_##name (type *x) \
+{ \
+ *x = __real foo_##name (5); \
+} \
+ \
+void \
+baz_##name (type *x) \
+{ \
+ *x = __imag foo_##name (5); \
+}
+
+typedef long double ldouble_t;
+typedef long long llong;
+
+T (float, float)
+T (double, double)
+T (long double, ldouble_t)
+T (char, char)
+T (short, short)
+T (int, int)
+T (long, long)
+T (long long, llong)
+#undef T
+
+int
+main (void)
+{
+#define T(type, name) \
+ { \
+ type var = 0; \
+ bar_##name (&var); \
+ if (var != 6) \
+ abort (); \
+ var = 0; \
+ baz_##name (&var); \
+ if (var != 4) \
+ abort (); \
+ }
+ T (float, float)
+ T (double, double)
+ T (long double, ldouble_t)
+ T (char, char)
+ T (short, short)
+ T (int, int)
+ T (long, long)
+ T (long long, llong)
+ return 0;
+}