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