1 // { dg-do assemble { target fpic } }
2 // { dg-options "-O2 -fweb -fPIC -fvisibility=hidden -Wno-return-type" }
3 // { dg-require-visibility "" }
9 inline operator int () const {return _q_value;}
17 QVariant toVariant () const;
19 class QScriptDebuggerBackendPrivate
21 static QScriptValue trace (QScriptContext *context);
23 template <typename T> struct QMetaTypeId { };
24 template <typename T> struct QMetaTypeId2
26 static inline int qt_metatype_id ()
28 return QMetaTypeId<T>::qt_metatype_id () ;
31 template <typename T> inline int qMetaTypeId (T * = 0)
33 return QMetaTypeId2<T>::qt_metatype_id () ;
36 template<typename T> inline T qvariant_cast (const QVariant &v)
38 const int vid = qMetaTypeId<T> ((0)) ;
44 QScriptValue callee () const;
49 static bool convertV2 (const QScriptValue &value , int type , void *ptr) ;
51 inline bool qscriptvalue_cast_helper (const QScriptValue &value , int type , void *ptr)
53 return QScriptEngine::convertV2 (value, type, ptr) ;
55 template<typename T> T qscriptvalue_cast (const QScriptValue &value)
58 const int id = qMetaTypeId<T> () ;
59 if ( qscriptvalue_cast_helper (value, id, &t))
60 return qvariant_cast<T> (value.toVariant ()) ;
62 template <> struct QMetaTypeId< QScriptDebuggerBackendPrivate* >
64 static int qt_metatype_id ()
66 static QBasicAtomicInt metatype_id = { (0) };
70 QScriptValue QScriptDebuggerBackendPrivate::trace (QScriptContext *context)
72 QScriptValue data = context->callee () ;
73 QScriptDebuggerBackendPrivate *self = qscriptvalue_cast<QScriptDebuggerBackendPrivate*> (data) ;
74 return QScriptValue();