This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15867] New: -Wredundant-decls and explicit template specialization
- From: "ghost at cs dot msu dot su" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jun 2004 05:17:03 -0000
- Subject: [Bug c++/15867] New: -Wredundant-decls and explicit template specialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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