Article ID: 131376
Article Last Modified on 7/5/2005
test.cpp(20) : error C2974: 'A' : invalid template actual argument '#1',
type expected
test.cpp(20) : error C2231: '.B<int,int>::A<int>::Afunc' : left operand
points to 'class', use '->'
test.cpp(20) : fatal error C1903: unable to recover from previous
error(s); stop ping compilation
/* Compile options needed: none
*/
// #define SHOW_TEMPLATE_ERROR
template <class Type>
class A
{
public:
Type a;
void Afunc(void){};
};
template <class Type1, class Type2>
class B: public A<Type1>
{
public:
void Bfunc()
{
#ifdef SHOW_TEMPLATE_ERROR
this->A<Type1>::Afunc();
#else
A<Type1>::Afunc();
#endif
}
};
void main()
{
B<int, int> b;
}
Additional query words: 2.00 2.10
Keywords: kbbug kbfix kbcpponly kbcompiler KB131376