In this code: class Base { virtual void baseMethod(){} }; template<typename Parent> class Derived: public Parent { virtual void derivedMethod(){} }; class SubDerived: public Derived<Base> { }; Code completion inside SubDerived offers to declare an override for derivedMethod, but not for baseMethod. (Real-world example of that template pattern: KDevPlatform duchain abstract builders)
This is a broader issue than just code completion. If I manually declare an override: class SubDerived: public Derived<Base> { virtual void baseMethod(); }; the tooltip for SubDerived::baseMethod doesn't say it's overriding a function from Base. However, clang clearly understands what's going on, because if I use "virtual void baseMethod() override;", it does *not* give the "marked 'override' but does not override" warning.
It does not work even for simple scenario like this: file: ClassB.hpp> #pragma once template<typename T> class ClassB { public: void DoSomething(int T) {} }; file: testClassB.cpp #include <ClassB.hpp> void testClassB() { ClassB<int> testInstance; testInstance.DoSomething( //here it does not propose arguments } In complex C++11,14,17 constructs it stops working complete, leaving me only with Automatic Word Completion nonsense.
Forgot to mention using KDevelop 5.1.2 from Neon KDE 5.11. The similar behavior observer also in KDevelop 5.0.4 and 5.1.80 from AppImage ran on the same system.
Yes, this is an issue. It requires something like https://reviews.llvm.org/D37650 to be merged in clang for fixing it.