JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestInterface>&& impl) { #if COMPILER(CLANG) // If you hit this failure the interface definition has the ImplementationLacksVTable // attribute. You should remove that attribute. If the class has subclasses // that may be passed through this toJS() function you should use the SkipVTableValidation // attribute to TestInterface. static_assert(!__is_polymorphic(TestInterface), "TestInterface is polymorphic but the IDL claims it is not"); #endif return createNewWrapper<JSTestInterface, TestInterface>(globalObject, WTFMove(impl)); }
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, readonly* impl) { if (!impl) return jsNull(); if (JSValue result = getExistingWrapper<JSreadonly>(exec, impl)) return result; #if COMPILER(CLANG) // If you hit this failure the interface definition has the ImplementationLacksVTable // attribute. You should remove that attribute. If the class has subclasses // that may be passed through this toJS() function you should use the SkipVTableValidation // attribute to readonly. COMPILE_ASSERT(!__is_polymorphic(readonly), readonly_is_polymorphic_but_idl_claims_not_to_be); #endif return createNewWrapper<JSreadonly>(exec, globalObject, impl); }
bool tde1 = __has_trivial_destructor(I); // { dg-error "incomplete type" } bool tde2 = __has_trivial_destructor(C[]); bool tde3 = __has_trivial_destructor(I[]); // { dg-error "incomplete type" } bool tde4 = __has_trivial_destructor(void); bool tde5 = __has_trivial_destructor(const void); bool abs1 = __is_abstract(I); // { dg-error "incomplete type" } bool abs2 = __is_abstract(C[]); bool abs3 = __is_abstract(I[]); // { dg-error "incomplete type" } bool abs4 = __is_abstract(void); bool abs5 = __is_abstract(const void); bool pod1 = __is_pod(I); // { dg-error "incomplete type" } bool pod2 = __is_pod(C[]); bool pod3 = __is_pod(I[]); // { dg-error "incomplete type" } bool pod4 = __is_pod(void); bool pod5 = __is_pod(const void); bool emp1 = __is_empty(I); // { dg-error "incomplete type" } bool emp2 = __is_empty(C[]); bool emp3 = __is_empty(I[]); // { dg-error "incomplete type" } bool emp4 = __is_empty(void); bool emp5 = __is_empty(const void); bool pol1 = __is_polymorphic(I); // { dg-error "incomplete type" } bool pol2 = __is_polymorphic(C[]); bool pol3 = __is_polymorphic(I[]); // { dg-error "incomplete type" } bool pol4 = __is_polymorphic(void); bool pol5 = __is_polymorphic(const void);
concept bool Polymorphic_type() { return __is_polymorphic(T); }