This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57136] New: Should redeclaration of class template with function pointer rather than function be an error?
- From: "kjw.chiu at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 01 May 2013 15:30:45 +0000
- Subject: [Bug c++/57136] New: Should redeclaration of class template with function pointer rather than function be an error?
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57136
Bug #: 57136
Summary: Should redeclaration of class template with function
pointer rather than function be an error?
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: kjw.chiu@gmail.com
'g++ -std=c++11 -Wall' compiles this without complaint:
template <void F(int)> class A;
template <void (*F)(int)> class A;
template <typename T, void F(T)> class B;
template <typename T, void (*F)(T)> class B;
clang++ issues an error for the redeclaration of class
B, but not for the redeclaration of class A. I filed
this as a bug at LLVM, where I was told that this is
correct, and that the rule is, if I understood it
correctly:
If a template parameter depends on a previous
template parameter, then it must be token-by-token
equivalent in any redeclaration.
I simply filing here for informative purposes. I have
not attempted to confirm this in the C++11
specification.