Indirect call not allowed

Indirect call not allowed

imagem de Javier Torres

Hi,

When trying to compile a code like this:

Class1::getInstance()->getClass2()->method1();

The compiler says: error: indirect call is not allowed inside [[transaction_safe]] routine.

Whereas if a variable is used to hold the results of the first function call:

Class2 class2 = Class1::getInstance()->getClass2();
class2->method1();

The compiler will not give any error. Why does the compiler work this way? Is there any way of overriding this behavior?

Thanks a lot, and greetings,

Javier

2 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Ravi Narayanaswamy (Intel)

Need to see code for Class1 and Class2. Working with author in a private mail

Faça login para deixar um comentário.