Login or Register

Offload™ Library Right Compiler Warnings

Offload1205

This Virtual Or Pointer Call May Fail Due To Missing Suitable Entry In Domain (declared At %1). This Call Requires A Local 'this


This virtual or pointer call may fail due to missing suitable entry in domain (declared at %1). This call requires a local 'this' pointer but none of the domain entries where declared with 'this'.

A virtual function is called on a local this pointer, but the domain does not contain any entry of matching signature declared with 'this'. The following example raises this warning:

struct str
{
	virtual void f();
};

void test()
{
	__offload [str::f] //domain declared  with virtual method/outer this
	{
		str v;
		str* ptr = &v;
		ptr->f(); // virtual call with a local this pointer
	}
}

The virtual inside the __offload block will fail because there is no function in the domain with local this pointer. To fix this problem the domain entry str::func needs to be follwed by 'this' keyword. Here is the correct domain [str::func this].