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++/57136] New: Should redeclaration of class template with function pointer rather than function be an error?


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.


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