[cfe-dev] 'template class used without template parameters'-error in gcc but not in Clang

Douglas Gregor dgregor at apple.com
Tue Oct 26 07:28:32 PDT 2010


On Oct 26, 2010, at 5:44 AM, Jan Bierbaum wrote:

> Hi!
> 
> 
> I'm not too familiar with the standard and templates, so I thought I'd
> better ask here before filing a bug.
> 
> When inside a method I refer to some method of a parent template class
> without explicit use of the template parameter, gcc reports an error
> while Clang does not. Which one is right?
> 
> example:
> 
>> $ cat a.cpp 
>> template <typename T>
>> class A {
>> public:
>>  void a() {};
>> };
>> 
>> 
>> class B : public A<int> {
>> public:
>>  void b() {A::a();}
>> };

Clang is correct. A is the injected-class-name of the base class A<int>.

  - Doug



More information about the cfe-dev mailing list