'gcc-3_4-branch'.
From-SVN: r92563
--- /dev/null
+// PR c++/18378
+
+class A
+{
+public:
+ int i;
+
+ A() {}
+ A(const A& a) { i = a.i; }
+};
+
+class B
+{
+ A a __attribute__((packed));
+
+public:
+ B() {}
+ A GetA() { return a; } // { dg-error "" }
+};
+
--- /dev/null
+// PR c++/18464
+
+struct A
+{
+ A(int);
+ operator void*() const;
+};
+
+template<int> void foo(const A& x) { 0 ? x : (x ? x : 0); }
--- /dev/null
+// PR c++/19034
+
+template< bool C > struct B
+{
+};
+
+template<typename S> int foo();
+template<typename S> int foo1();
+
+template<typename T> struct bar : public B <(sizeof(foo<T>()) == 1)>
+{
+};
+
+template<typename T> struct bar1 : public B <(sizeof(foo1<T>()) == 1)>
+{
+};
--- /dev/null
+// PR c++/18962
+
+template<class T1,int N1>
+class Class
+{
+public:
+ template <class T2,int N2>
+ void function( const Class<T2,N2>& );
+};
+
+template<>
+template<class T2,int N2>
+void Class<int,1>::function( const Class<T2,N2>& param )
+{
+ param; // make sure we use the argument list from the definition.
+}
+
+int main()
+{
+ Class<int,1> instance;
+ Class<char,2> param;
+ instance.function( param );
+}
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <iface.h>
+
+void check (JNIEnv *);
+
+void check(JNIEnv *env)
+{
+ if ((*env)->ExceptionCheck(env) != JNI_FALSE)
+ {
+ fprintf(stderr, "UNEXPECTED EXCEPTION\n");
+ exit(-1);
+ }
+}
+
+void
+Java_iface_doCalls (JNIEnv *env, jobject self, jobject other)
+{
+ jclass iface_class, comparable_class;
+ jmethodID iface_meth, comparable_meth;
+ jvalue args[1];
+
+ iface_class = (*env)->FindClass(env, "iface");
+ check (env);
+ comparable_class = (*env)->FindClass (env, "mycomp");
+ check (env);
+
+ iface_meth = (*env)->GetMethodID (env, iface_class, "compareTo",
+ "(Ljava/lang/Object;)I");
+ check (env);
+ comparable_meth = (*env)->GetMethodID (env, comparable_class, "compareTo",
+ "(Ljava/lang/Object;)I");
+ check (env);
+
+ args[0].l = other;
+ (*env)->CallObjectMethodA (env, self, iface_meth, args);
+ check (env);
+ (*env)->CallObjectMethodA (env, self, comparable_meth, args);
+ check (env);
+}
--- /dev/null
+// JNI calls via an interface method were broken in a couple releases.
+
+interface mycomp
+{
+ int compareTo(Object x);
+}
+
+public class iface implements mycomp
+{
+ static
+ {
+ System.loadLibrary("iface");
+ }
+
+ public int compareTo (Object x)
+ {
+ System.out.println ("hi maude");
+ return 3;
+ }
+
+ public native void doCalls(Object x);
+
+ public static void main (String[] args)
+ {
+ new iface().doCalls(args);
+ }
+}
--- /dev/null
+hi maude
+hi maude