Tool/software: TI C/C++ Compiler
Hi,
I have an issue with using a template argument in a base class. It looks like the compiler doesn't notice the base class at all. Even my actual code is a bit more complex the following code snippet demonstrates the issue:
template <class T1>
class Foo
{
public:
T1 p1;
virtual void dump() {
printf("%08X: %i\n", this, p1);
}
};
template <class T1, class T2>
class Bar : public Foo<T1>
{
public:
T2 p2;
virtual void dump() {
printf("%08X: %i, %i\n", this, p1, p2); // error #20: identifier "p1" is undefined
}
};
void test()
{
Bar<int, int> bar;
bar.p1 = 1; // ok !!!
bar.p2 = 2;
bar.dump();
}
Accessing a base class member in the implementation of the derived class throws compiler error #20 (identifier undefined). Doing the same from outside the class seems to work.
The same code works fine with MS VC.
I am using DM814x, SYS/BIOS v6.35.06.56, XDCTools v3.25.06.96 and ARM CGT v5.2.5. (I quickly tried to update to ARM CGT 18.1.2, it seems to have the same issue, despite some other problems in the libcxx include files ...)
Any idea?
Thanks, Lars