Advanced CLang Intellisense engine

Sysprogs forums Forums VisualGDB Advanced CLang Intellisense engine

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25071
    andrew.bentley
    Participant

    I am consistently having problems with Intellisense not recognizing inheritance hierarchies very well. One specific instance that I run into this is when calling a public or protected function from a parent class. For example:

    class Parent {
        void SomeFunction();
    }
    
    class Child : public Parent{}
    
    Child::AnotherFunction() 
    {
        SomeFunction();      //<---- Intellisense doesn't like this
    }

    Error: cannot initialize object parameter of type Parent with an expression of type Child
    Do you have any idea as to what is happening here? Am I missing some crucial setting? This is a GNU Make Linux project.

    #25074
    support
    Keymaster

    The error looks correct (the private functions Parent are not accessible to derived classes). You can double-check this by trying to build the project – the compiler should show the same error.

    #25076
    andrew.bentley
    Participant

    I apologize for being unclear, I missed the “public:” declaration. The parent functions in this case are indeed public so are accessible to the derived classes. The code compiles and runs correctly, it’s only intellisense that gives me issues on this.

    #25077
    support
    Keymaster

    No problem. Most likely this is caused by some other declaration or setting. Please try getting a minimal example that triggers the problem on a newly created project and share it with us so that we could see what is going on.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.