This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]