[Bug c++/15867] New: -Wredundant-decls and explicit template specialization

ghost at cs dot msu dot su gcc-bugzilla@gcc.gnu.org
Tue Jun 8 05:17:00 GMT 2004


When compiling  
   template<class T, class charT> 
   class validator { 
   public: 
       void operator()() {}         
   }; 
 
   template<> 
   void validator<bool, char>::operator()(); 
 
   int main() {} 
 
With  
   g++-3.4 -Wredundant-decls  red.cpp 
 
I get this output: 
   red.cpp:9: warning: redundant redeclaration of `void validator<T,   
      charT>::operator()() [with T = bool, charT = char]' in same scope 
   red.cpp:5: warning: previous declaration of `void validator<T, 
      charT>::operator()() [with T = bool, charT = char]' 
 
I think the warning is incorrect. I'm specializating the member function, 
not redeclaring it.

-- 
           Summary: -Wredundant-decls and explicit template specialization
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ghost at cs dot msu dot su
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15867



More information about the Gcc-bugs mailing list