[llvm-bugs] [Bug 37822] New: An unfixed bug?

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jun 16 19:10:08 PDT 2018


            Bug ID: 37822
           Summary: An unfixed bug?
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zhonghao at pku.org.cn
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

The code is as follow:

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;

It comes from a previous bug report: https://bugs.llvm.org/show_bug.cgi?id=8650

It is said to be fixed. However, when I compile the above code with the latest
clang++, it produces the following errors:

error: no matching member function for call to '_M_check'
note: in instantiation of member function 'array<double, 3>::at' requested here
note: candidate template ignored: substitution failure [with _Mm = 3]: non-type
template argument evaluates to 3, which cannot be narrowed to type 'bool'
     template<int _Mm> typename enable_if<_Mm, void>::type _M_check(int) const
{ }
                                          ~~~              ^
    1 error generated.

Is the bug not fully fixed?

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180617/94ff3b0a/attachment.html>

More information about the llvm-bugs mailing list