[prev in list] [next in list] [prev in thread] [next in thread]
List: kdevelop-bugs
Subject: [Bug 220287] New: deriving from a template class causes kdevelop's
From: Thorben Kröger <thorbenk () gmx ! net>
Date: 2009-12-27 16:02:12
Message-ID: bug-220287-40295 () http ! bugs ! kde ! org/
[Download RAW message or body]
https://bugs.kde.org/show_bug.cgi?id=220287
Summary: deriving from a template class causes kdevelop's c++
analysis some trouble
Product: kdevelop
Version: SVN
Platform: Compiled Sources
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: cpp-parser
AssignedTo: kdevelop-bugs@kdevelop.org
ReportedBy: thorbenk@gmx.net
Created an attachment (id=39390)
--> (http://bugs.kde.org/attachment.cgi?id=39390)
small testcase
Here is a small test program, annotated with the problems.
Please tell me if it's useful if I continue to provide these types of small
examples, or if you know about this already?
#include <iostream>
template<class T>
class A {
public:
A() {}
protected:
int A_test;
};
template<class T>
class B : public A<T> {
public:
B();
void print() {
//
// this->A_test is underlined in _red_ here
//
std::cout << this->A_test << ", " << this->B_test << std::endl;
}
protected:
int B_test;
};
template<class T>
B<T>::B()
: A<T>() { //A<T> is underlined in _yellow_
this->A_test = 1; //this->A_test is underlined in _yellow_
this->B_test = 2;
}
template<class T>
class C : public A<int> {
public:
C() {
//
// this->A_test is analyzed correctly, note that we know the template
type to be "int" here
//
this->A_test = 3;
this->C_test = 4;
}
void print() { std::cout << this->A_test << ", " << this->C_test <<
std::endl; }
protected:
int C_test;
};
int main() {
B<int> b;
b.print();
C<int> c;
c.print();
}
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic