Bug 580583 - indexer report Error for virtual method in class derived from a template class
Summary: indexer report Error for virtual method in class derived from a template class
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 8.8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-22 04:49 EDT by Rainer CLA
Modified: 2022-08-22 04:49 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer CLA 2022-08-22 04:49:21 EDT
Hi.

I have following declerations in a header file.

template <typename Key>
class Virtuals {
private:
    virtual Key getKey() const = 0;
public:
    Virtuals() {}

    virtual ~Virtuals() {}
};

class Derived : public Virtuals<int> {
private:
    inline virtual int getKey() const { return int(); }
};

void test();

In the corresponding cpp file I defined the method test() in following way:

void test() {
    Derived d;
}

This code would be compile without any problem, but the indexer of Eclipse CDT reports following error in the definition of test() at the place where an object of Derived will be created:

The type 'Derived' must implement the inherited pure virtual method 
 'Virtuals::getKey'

I'm using CDT 8.8.0.201509131935 unter Linux. I think this is an error.