[LLVMbugs] [Bug 8650] New: no implicit conversion in template values

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 18 15:18:36 PST 2010


           Summary: no implicit conversion in template values
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: marc.glisse at normalesup.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

This code (from libstdc++ in gcc-4.2) fails to compile. Is it on purpose?

template<bool, typename> struct enable_if {};
template<typename T> struct enable_if<true,T> {
 typedef T type;
template<typename _Tp, int _Nm> struct array {
 void at(int n) {
 template<int _Mm> typename enable_if<_Mm, void>::type _M_check(int) const { }
 // template<int _Mm> typename enable_if<_Mm!=0, void>::type _M_check(int)
const { }
int main(){
 array<double,3> a;

bug.cpp:7:3: error: no matching member function for call to '_M_check'
bug.cpp:14:4: note: in instantiation of member function 'array<double, 3>::at'
requested here
bug.cpp:9:56: note: candidate template ignored: substitution failure [with _Mm
= 3]
 template<int _Mm> typename enable_if<_Mm, void>::type _M_check(int) const { }

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.

More information about the llvm-bugs mailing list