http://llvm.org/bugs/show_bug.cgi?id=15013

             Bug #: 15013
           Summary: Compilation problem using function pointer as non-type
                    template parameter
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


This code fails to compile:

template <typename A, void (A::*F)()>
struct T {};

struct foo
{
    void bar() const {}
    typedef T<foo const, &foo::bar> bar_type;
};

int main()
{
    return 0;
}

even if it should (and it compiles with gcc, VC, comeau).

The generated error is:

test.cpp:7:22: error: non-type template argument of type 'void (foo::*)()
const' cannot be converted to a value of type 'void (const foo::*)()'
typedef T<foo const, &foo::bar> bar_type;
                     ^~~~~~~~~
test.cpp:1:33: note: template parameter is declared here
template <typename A, void (A::*F)()>

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to