| Summary: | Semantic analyzer fails with class inheriting from templated typedef | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Sandro Mani <manisandro> |
| Component: | Language Support: CPP (old) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 4.2.1 | ||
| Target Milestone: | 4.2.0 | ||
| Platform: | Fedora RPMs | ||
| OS: | Linux | ||
| Latest Commit: | http://commits.kde.org/kdevelop/4880f3f5dc2893d540e0030119aefb6b92084fd6 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
Git commit 4880f3f5dc2893d540e0030119aefb6b92084fd6 by Milian Wolff. Committed on 08/08/2013 at 21:06. Pushed by mwolff into branch 'master'. Unalias type after delayed type resolution befor baseClass import. This fixes a bug where semantic analsis failed for typedefed template arguments in base classes. M +2 -1 languages/cpp/cppduchain/templatedeclaration.cpp A +46 -0 languages/cpp/tests/cpptestfiles/typedef_template_arg.cpp [License: LGPL (v2)] http://commits.kde.org/kdevelop/4880f3f5dc2893d540e0030119aefb6b92084fd6 |
Version: 4.2.1 (using KDE 4.6.2) OS: Linux Consider this sample program: ------------------------------------- #include <iostream> template <typename T> class A { public: void print(T val){ std::cout<<val<<"\n"; } }; template <typename T> struct B { typedef A<T> Printer; }; template <typename T> class C : public B<T>::Printer {}; int main(int argc, char **argv) { B<int>::Printer instance; instance.print(2); C<int> inherited_instance; inherited_instance.print(2); return 0; } ------------------------------------- The semantic analyzer will correctly detect that instance has a member function "print", but fails with inherited_instance. Reproducible: Always Steps to Reproduce: Create new cpp file, let kdevelop analyze the code posted in Details. Actual Results: Functions inherited from templated typedefed classes are not found by the analyzer. Expected Results: Analyzer should find these functions. OS: Linux (x86_64) release 2.6.35.12-88.fc14.x86_64 Compiler: gcc kdevplatform-1.2.2-1.fc14.x86_64 kdevelop-4.2.2-1.fc14.x86_64 kdevplatform-libs-1.2.2-1.fc14.x86_64 kdevelop-libs-4.2.2-1.fc14.x86_64 The actual case where I encounter this issue a lot is OpenMesh.