Why does CLion think this 'recurses indefinitely'
// template <typename _T>
class testA {
public:
virtual void hello(int t) { ssa = t; }
virtual int say_hello() { return ssa; }
protected:
int ssa ;
};
class testB: public testA {
public:
void hello(int t) override {
this->testA::hello(3);
}
};
int main() {
testB tb;
tb.hello(2);
std::cout << tb.say_hello() << std::endl;
tb.testA::hello(2);
std::cout << tb.say_hello() << std::endl;
}
if I run this program, it exits normally as expected:
/Users/MsIsShit/CLionProjects/hello/cmake-build-default/hello
3
2
Process finished with exit code 0
Please sign in to leave a comment.
