Indirect call not allowed

Indirect call not allowed


When trying to compile a code like this:


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

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

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

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,


2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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

Faça login para deixar um comentário.