2 // { dg-options "-fdollars-in-identifiers" }
3 // Origin: Giovanni Bajo <giovannibajo at libero dot it>
4 // Make sure that Java special functions can be called correctly.
8 typedef __java_int jint;
21 typedef struct java::lang::Object* jobject;
22 typedef struct java::lang::Throwable* jthrowable;
23 typedef class java::lang::Class* jclass;
24 using java::lang::Foo;
26 class Foo : public java::lang::Throwable
29 static ::java::lang::Class class$;
34 * Step 1: no declarations. A declaration for _Jv_Throw is created.
39 Foo* f = new java::lang::Foo; // { dg-error "call to Java constructor" }
45 * Step 2: constructor declaration
48 extern "C" jobject _Jv_AllocObject (jclass) __attribute__((__malloc__));
52 Foo* f = new java::lang::Foo;
61 jobject _Jv_AllocObject (jclass, jint, float) __attribute__((__malloc__));
62 void _Jv_Throw (int, float) __attribute__ ((__noreturn__));
66 Foo* f = new java::lang::Foo; // { dg-error "should never be overloaded" }
67 throw (f); // { dg-error "should never be overloaded" }