http://llvm.org/bugs/show_bug.cgi?id=8650
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: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
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) {
_M_check<_Nm>(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;
a.at(0);
}
bug.cpp:7:3: error: no matching member function for call to '_M_check'
_M_check<_Nm>(n);
^~~~~~~~~~~~~
bug.cpp:14:4: note: in instantiation of member function 'array<double, 3>::at'
requested here
a.at(0);
^
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs